Results 1 to 9 of 9

Thread: how to store uploaded files into a dataset?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Question 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.

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    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

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    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

  6. #6
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    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

  8. #8
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  9. #9
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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
  •  



Click Here to Expand Forum to Full Width