|
-
Jul 29th, 2011, 12:41 AM
#1
Thread Starter
Fanatic Member
how to store uploaded files into a dataset?
Dear All,
my asp.net app has file upload capability, I need to store uploaded files (ie. .tar, .zip, .doc, tif .. etc) into a dataset before they being stored into mysql db..
could any body please advise how to store uploaded files into a dataset?
thanks & regards
Last edited by Winanjaya; Jul 29th, 2011 at 12:47 AM.
-
Jul 29th, 2011, 01:32 AM
#2
Re: how to store uploaded files into a dataset?
Hello,
Just to confirm, are you talking about uploading a file, converting it into a byte array, and storing that in the dataset/database, or are you talking about uploading a file, storing it on the filesystem, and then storing a path to the file in the dataset/database?
Gary
-
Jul 29th, 2011, 01:55 AM
#3
Thread Starter
Fanatic Member
Re: how to store uploaded files into a dataset?
Hi,
I am talking about storing any file types into dataset.. and I also able to download it from dataset..
please help
TIA
-
Jul 29th, 2011, 06:49 AM
#4
Re: how to store uploaded files into a dataset?
How often are files going to be stored (and retrieved) in this manner? Often, hardly? Do you plan on this being a high volume action at some point?
Because if this is the case then you do NOT want to be storing the files themselves in the database. You will be better off storing them in the file system and simply saving a path/filename reference to it instead.
-tg
-
Jul 29th, 2011, 06:56 AM
#5
Thread Starter
Fanatic Member
Re: how to store uploaded files into a dataset?
Hi..
not too often.. users able to store the files (as supporting documents).. the files should be able to be retrieve for some purposes..
I am going to store the files into a dataset/database because I need to identify the files based on a primary-key.
any idea?
TIA
-
Jul 29th, 2011, 07:30 AM
#6
Re: how to store uploaded files into a dataset?
I would jsut store the path/file name (from the perspective of the server... NOT the client) in the database, along with a PKey ... but the file itself I'd still store on the file system of the server somehow. It'd going to make retrieval of the files later easier and it's not going to bloat your database.
-tg
-
Jul 29th, 2011, 08:01 AM
#7
Thread Starter
Fanatic Member
Re: how to store uploaded files into a dataset?
hmm, it should be 1 issue for me ..
I need to create a folder based on PKey.. my PKey is an auto-increment integer value .. so I would create a folder called 1, 2, 3 and so on..
mywebfolder\Files\PKey .. it would be
mywebfolder\Files\1
mywebfolder\Files\2
mywebfolder\Files\3
..
how to create it inside the webfolder?
please advise
Thanks & Regards
-
Jul 29th, 2011, 09:26 AM
#8
Re: how to store uploaded files into a dataset?
woaza! Um... WHY? There's no need to be going around creating folders, ESPECIALLY if it's based on a PKey, which means only one file per folder...
I would put the files into a folder called "Uploads" .... then the uploads table would have at least two fields:
tblUploadFiles:
ID - PKey - Auto Increment
FileName - varchar
Now... if you want to introduce some obscurity then you can do something like this:
tblUploadFiles:
ID - PKey - Auto Increment
RealFileName - varchar
SavedFileName - uniqueidentifier (GUID)
and then use the SavedFileName to rename the file on the server.
I think you're slightly over thinking things...
-tg
-
Jul 29th, 2011, 02:19 PM
#9
Re: how to store uploaded files into a dataset?
For what it is worth, I agree with tg.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|