简体   繁体   中英

Blueimp jQuery File Upload with Additional title field editing

Using http://blueimp.github.io/jQuery-File-Upload/ I am trying to add a title field to go with uploaded image. Once uploaded I want to be able to edit the title field for each image. I am associating each image with an entity in the database successfully but I can't find a way to add and edit an additional title field.

You can add any data to send with the formData option. Let's see the documentation .

You also can add data to the data object, it's the same object you'll get with the response:

.on('fileuploadadd', function (e, data) 
{
    $.each(data.files, function (index, file) 
    {
        file.myTitle = 'anyThing';
    });
});

With both solution you can add your title and an extra parameter to inform your DB if it's an edit or an insert.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM