Sending additional data for uploaded files

Last post 08-18-2009, 12:51 PM by msu.falcon. 3 replies.
Sort Posts: Previous Next
  •  08-12-2009, 11:00 AM 54653

    Sending additional data for uploaded files


    Hello,
     
    I can't find a way to pass additional information or metadata up to the server for use with each uploaded file.
     
    For example, I need to have IDs for which category the file data should be placed in, and also what type of data it is (specific to our application).
     
    Did I miss how to do this, or is it not supported? In an ideal world, it seems like it would be good if the UploaderEventArgs object were extended to have and additional Object or String field that could be set on the client prior to the upload.
     
    Any ideas about how I can get this information in the FileUploaded event?
     
    Thanks in advance.
  •  08-12-2009, 11:19 AM 54658 in reply to 54653

    Re: Sending additional data for uploaded files

    Hi,
     
    You can use ViewState, <input type='hidden' /> , Session etc to pass the parameters.
     
    Regards,
    Terry
     
  •  08-18-2009, 8:29 AM 54760 in reply to 54658

    Re: Sending additional data for uploaded files

    Hi,
     
    Hmm.
    Is it possible to do the following.
     
    1. select multiple files to upload
    2. generate a textbox for each file to enter a title or new filename
    3. click upload?
     
    if so.. how? :)
  •  08-18-2009, 12:51 PM 54766 in reply to 54760

    Re: Sending additional data for uploaded files

    NoCode, that's very similar to what I'm wanting to do in my DetailsView thread.
     
    We have metadata that needs to be entered into a database at the "same time" as the file being uploaded. (By same time I mean uploading the file first, then inserting the data into the database, but we'd do all that on one click.)
     
    The only snag I'm hitting is that I'm not sure how to validate that a file has been selected to be uploaded in the uploader (and make sure it's the right file extension, but I could do that manually if need-be) and don't know how to manually start the upload process (I'm assuming it's a JavaScript function call, but I've been unable to find it in the documentation).
     
    With enough information for a case of one file, it shouldn't be hard to then do the same for multiple files.
View as RSS news feed in XML