Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Store files temporarily

Store files temporarily

Scheduled Pinned Locked Moved ASP.NET
javascriptquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SummerBulb
    wrote on last edited by
    #1

    Hi, I have a web form that allows users to upload files while opening a ticket in our system. The upload is done using the "ajax control toolkit" asyncFileUpload. Currently, the files are saved to a temp directory and will only be save to the permanent location when the user hits the "commit" button. I would like to be able to get rid of temp files that are no longer relevant (e.g. The user leaves the page open for a month without posting the form). What would be the best way to not keep temp files forever. Maybe keeping them files in the session? Maybe keeping them in the viewstate? I could add some JS to the page with a timeout and add some code that runs when the user leaves the page. But these ideas are client side solutions. I wouldn't want someone to tamper with the code and leave me rubbish on my system. Any other idea? Thanks, Summerbulb

    G D 2 Replies Last reply
    0
    • S SummerBulb

      Hi, I have a web form that allows users to upload files while opening a ticket in our system. The upload is done using the "ajax control toolkit" asyncFileUpload. Currently, the files are saved to a temp directory and will only be save to the permanent location when the user hits the "commit" button. I would like to be able to get rid of temp files that are no longer relevant (e.g. The user leaves the page open for a month without posting the form). What would be the best way to not keep temp files forever. Maybe keeping them files in the session? Maybe keeping them in the viewstate? I could add some JS to the page with a timeout and add some code that runs when the user leaves the page. But these ideas are client side solutions. I wouldn't want someone to tamper with the code and leave me rubbish on my system. Any other idea? Thanks, Summerbulb

      G Offline
      G Offline
      GenJerDan
      wrote on last edited by
      #2

      Service/scheduled task on the server that will delete files older than X?

      I thought you had to go to Pittsburgh for that. My Mu[sic] My Films My Windows Programs, etc.

      1 Reply Last reply
      0
      • S SummerBulb

        Hi, I have a web form that allows users to upload files while opening a ticket in our system. The upload is done using the "ajax control toolkit" asyncFileUpload. Currently, the files are saved to a temp directory and will only be save to the permanent location when the user hits the "commit" button. I would like to be able to get rid of temp files that are no longer relevant (e.g. The user leaves the page open for a month without posting the form). What would be the best way to not keep temp files forever. Maybe keeping them files in the session? Maybe keeping them in the viewstate? I could add some JS to the page with a timeout and add some code that runs when the user leaves the page. But these ideas are client side solutions. I wouldn't want someone to tamper with the code and leave me rubbish on my system. Any other idea? Thanks, Summerbulb

        D Offline
        D Offline
        David Mujica
        wrote on last edited by
        #3

        How about placing the cleanup code in the same area as where the user is allowed to upload his files temporarily. Something like: 1) User wants to upload file. 2) check for any files that are older than "X" days and delete them 3) Continue with the upload logic This eliminates the need for creating a separate task that would run as a service or scheduled task. Just a thought. :cool:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups