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. Cant save a file

Cant save a file

Scheduled Pinned Locked Moved ASP.NET
csharpvisual-studiowindows-admindebugginghelp
2 Posts 2 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.
  • N Offline
    N Offline
    niceguyeddie1999
    wrote on last edited by
    #1

    Hi, I have an aspx page which takes in a htmlinputfile and puts this into an object which is put on the session for the next page. The next page takes this off the session and saves the file. This works grand when I run it in debug mode in visual studio but when I copy it over to IIS IM getting the following error when I try to save the file Exception Details: System.ObjectDisposedException: Cannot access a closed file. Any ideas? Thanks in advance

    G 1 Reply Last reply
    0
    • N niceguyeddie1999

      Hi, I have an aspx page which takes in a htmlinputfile and puts this into an object which is put on the session for the next page. The next page takes this off the session and saves the file. This works grand when I run it in debug mode in visual studio but when I copy it over to IIS IM getting the following error when I try to save the file Exception Details: System.ObjectDisposedException: Cannot access a closed file. Any ideas? Thanks in advance

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

      Ouch! Don't do that. If you manage to get it to work, you will be keeping the uploaded file in memory between requests. If the second request never comes, it will stay in memory until the session times out, normally after 20 minutes. The application would be totally open for a DoS attack. You just have to upload a lot of files, and it will use up all the memory of the server. Why don't you save the file when you recieve it? --- b { font-weight: normal; }

      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