SlickUpload
Welcome Guest Search | Active Topics | Log In | Register

Multiple files in a POST question Options
kev3232
#1 Posted : Tuesday, January 24, 2012 4:39:52 PM
Rank: Advanced Member

Groups: Registered

Joined: 10/27/2005
Posts: 35

Chris,

We have SlickUpload 6 setup and working against an existing HTML form post page. It allows up to five files to get posted at once. This all works great, unless a user has an issue in the middle of the upload (like a disconnect). Since we are unable to commit the session, any files that completed successfully are deleted from disk.

Is it possible to avoid this issue, like somehow indicate that a certain file should be kept? Perhaps in CloseWriteStream since isComplete would be true? I suspect this would be new functionality so wanted to run it by you.

(this is related to the larger post I made way back when -- Slickupload 6 with uploadFilter and different handler)

Thanks

Axosoft
#2 Posted : Wednesday, January 25, 2012 3:54:58 PM
Rank: Administration


Groups: Administrators

Joined: 7/7/2005
Posts: 1,586
Location: Scottsdale, AZ

You're doing a post from a plain HTML form, and want to retain the files even if the POST fails at some point? Where do you have your code implemented that handles completed files? Would that still get called?

The simplest way to work around the auto-deletion would be to upload to a temporary location, and then do a File.Move in CloseWriteStream (if isComplete=true) to move the file to the final location. That way, the automatic cleanup wouldn't remove the file, even if the upload request failed, as any completed files would be moved out of the temporary upload location.

Would that work in your scenario?

kev3232
#3 Posted : Wednesday, January 25, 2012 7:04:33 PM
Rank: Advanced Member

Groups: Registered

Joined: 10/27/2005
Posts: 35
Our code calls the "completed" file code in CloseWriteStream. Since this is called for each file in the post, it sounds like you understand the issue.

Your idea sounds reasonable, although it slightly changes our file flow. I'll see what that entails and let you know. Thanks for the help.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.