using mulitFile to write each file's attributes to sql database

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

using mulitFile to write each file's attributes to sql database

dougm
Hi Dean, My client would like to choose about 30 or so excel & pdf's files for upload, then loop through each file to get it's File Name and File Extension then write that Name and Extension data to a sql 2000 database. I've begun designing my .aspx page with the multiFile but need some suggestions as to how to handle the C# code behind for each file that needs it's File Name and File Type to be written to the sql table, and have each of the files saved to a specific directory nested in a sub folder within my app. Once the files are collected and stored in the correct directory, I'll create a gridView for users to sort and view the files. Thank you for any insight you can provide, Doug
Reply | Threaded
Open this post in threaded view
|

Re: using mulitFile to write each file's attributes to sql database

dougm
Ahh - more info - I'm using NeatUpload 1.3.13. Sql Table info: POSID int POFileName varchar(50) POFileType varchar (10) DateUpdated datetime (PO = Purchase Order) Thanks Dean.
Reply | Threaded
Open this post in threaded view
|

Re: using mulitFile to write each file's attributes to sql database

Dean Brettle
Administrator
This doesn't sound NeatUpload-specific.  If you were using a set of FileUpload of HtmlInputFile controls, you would loop through the HttpPostedFile objects returned by Request.Files, and use the FileName property of each object to calculate the values to put in your DB.  With NeatUpload's MultiFile control, you loop through the UploadedFile objects returned by multiFile.Files, and use the FileName property of each object to calculagte the values to put in your DB.  Make sense?

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

Re: using mulitFile to write each file's attributes to sql database

dougm
Hi Dean, Yes, makes sence. As for using NeatUpload multiFile vs. a set of FileUpload objects, well - the multiFile is just a far more elegant (and easier) for the user when uploading multiple files. Thanks for your insight.
Reply | Threaded
Open this post in threaded view
|

Re: using mulitFile to write each file's attributes to sql database

Dean Brettle
Administrator
I wasn't recommending using multiple FileUploads instead of a MultiFile.  I was just pointing out that the way to write the code-behind is very similar for both cases.
--Dean