locked
Ajaxfileupload and Custom Title RRS feed

  • Question

  • User440544100 posted

    Hi,

    I am quite new to this exciting world but became stumped trying to see if this was possible:

    I have been able to get Ajaxfileupload working for multiple uploads, etc with the ability to insert key pieces of information into SQL thanks to all the great examples out here (using c#). As I got further involved I wondered if it is possible to have a user also edit/insert custom files names or custom file description that too get inserted into a table?

    Thanks for any help and/or additonal resources that might be useful.

    Cheers

    Thursday, January 16, 2014 12:27 PM

Answers

  • User-417640953 posted

    Hi naylard,

    Welcome to asp.net forum.

    According to your description, I see you want the users can define custom filename when using AjaxFileUpload upload file.

    This is not a easy job. Just think that, if we want define self filename, we must send the message to the server side. In other words, we must

    get the custom filename in the method AjaxFileUpload1_UploadComplete(object sender, AjaxControlToolkit.AjaxFileUploadEventArgs e).

    As we all know that the method is called asynchronously with the AjaxFileUploadHandler.axd handler.

    Fortunately, there is a property "ContextKeys" used to pass information to the server when a file is uploaded. However the property is not implemented.

    If you want to use this property to pass custom file name to UploadComplete method, you should make some change with the ajaxtoolkit code.

    Please check below issue, someone has provided how to implement the ContextKeys property.

    http://stackoverflow.com/questions/13080186/how-can-i-use-the-contextkeys-property-for-the-ajaxfileupload-control

    If you done above job, it is easy to complete AjaxFileUpload1 with custom file name or description.

    Hope this helps, thanks.

    Best Regards!

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Friday, January 17, 2014 5:07 AM