SqlServerUploader Overwrite existing file

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

SqlServerUploader Overwrite existing file

Adam Seacrest

Dean,

 

I got the SqlServerUploader working  and its great. To test I uploaded an 800 Mb iso image with no problem :) .  What I am tring to do now is overwrite the image data. for instance, say a user uploads a pdf file. Then they realize that it was the wrong one. Since I have to link to the file table by Identity, I need that value to remaine the same while updating the filename and DataFileld values. I have tried verify(), inputFile.MoveTo(inputFile.FileName, MoveToOptions.Overwrite) but it just adds a new record. This is the last snag I have to get over before this becomes a viable solution. I know with all the work you have put in to this, what I need is there, I just cant find it.

Thanks,

Adam

Reply | Threaded
Open this post in threaded view
|

Re: SqlServerUploader Overwrite existing file

Dean Brettle
Administrator
Actually, the functionality you are looking for isn't there.  I recommend doing the following:
1. Have your FileTable only contain the fields needed by NeatUpload.
2. Store any other info that your app associates with the file in a separate table that also contains the id of the row in the FileTable.
3. When the user uploads a replacement file, change the id in your table to reflect the id of the new row in the FileTable, and delete the old row in the FileTable.

Hope that helps,

--Dean
Reply | Threaded
Open this post in threaded view
|

Re: SqlServerUploader Overwrite existing file

Guest-1021

Dean

Thanks for the quick response, I have been working on that method while waiting for you reply.

 

Thanks,

Adam