How to store database ids

Last post 04-06-2010, 12:14 AM by cutechat. 3 replies.
Sort Posts: Previous Next
  •  03-24-2010, 11:36 PM 59637

    How to store database ids

    hi,
    i am testing the ajax uploader and trying to figure out the following. if anyone can help i would greatly appreciate it.
     
    when uploading multiple files via ajax in .net mvc i am inserting each uploaded file into database in the IHttpHandler. I need to be able to store the database id for each of the inserted files. is there any way i can store additional properties/values/attributes with the MvcUploadFile object and then access it when upload has been completed for all files? if not, what other options do i have? how can i temporarily store some additional properties of the uploaded files? i noticed loader INPUT tag's value attribute holds the temp file guids. i went through the documentation but there is nothing there about this.
     
    also, how do i pass some parameter to my IHttpHandler via uploader object that's inserting the file into db? let's say i want to use user id in the IHttpHandler so i can insert the file into db for the correct user.
     
     
    thanks 
  •  03-25-2010, 10:17 AM 59652 in reply to 59637

    Re: How to store database ids

    Dear emer,
     
    Please refer to http://ajaxuploader.com/Demo/Ajax-based-File-storage.aspx,  you can find its source code in download package, path is \Ajax-Uploader\AdvancedCS20\Ajax-based-File-storage.aspx.
     
    Regards,
    Eric
  •  03-25-2010, 11:30 AM 59654 in reply to 59652

    Re: How to store database ids

    eric,
    the sample u referred me to is done in WebForms. I need to make this work in .NET MVC. I need to be able to store additional info for each of the uploaded files using .net mvc. is there something like "single file upload complete" handler for javascript? and if so, how do i make sure i pass some parameter from IHttpHandler (after single file has been uploaded and inserted into database) to this "single file upload complete" handler?
  •  04-06-2010, 12:14 AM 59891 in reply to 59654

    Re: How to store database ids

    Hi,
     
    Uploader alloc new GUID for each files.
     
    You can get it at client side or server side.
     
    at client side, you can get it via this way :
     
    var hidden=document.getElementById("UploaderID");
    var guidlist=hidden.value.split("/");
     
    Regards,
    Terry
View as RSS news feed in XML