{"comment":{"created_at":"2011-10-19T22:37:16Z","body":"Hey guys, i had this problem some time ago with an extra select option i need the user select for each uploaded file, the way i managed to work is this, in the send callback method i append the selected option value of the current file to the data.data object, like this:\r\n\r\nsend: funciton (e, data){\r\n     data.data.append(\"param_name[]\",data.context.find('select').val())\r\n}\r\n\r\n\r\nI guess is the same thing with any kind of input you need to post.\r\n\r\nUnfortunately, today i noticed Firefox 3.6 does not have the data.data object. @blueimp do you know a similar way to add this when is an iframe transport?, Thanks. \r\n","updated_at":"2011-10-19T22:37:16Z","url":"https://api.github.com/repos/blueimp/jQuery-File-Upload/issues/comments/2462366","id":2462366,"user":{"avatar_url":"https://secure.gravatar.com/avatar/6abd2ec7d28a881acfb2a516eecfee42?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"6abd2ec7d28a881acfb2a516eecfee42","url":"https://api.github.com/users/luisgodinez","id":424253,"login":"luisgodinez"}},"action":"created","issue":{"number":628,"created_at":"2011-09-19T18:25:17Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I'd like for clients to be able to submit extra form data along with uploaded photos, in the form of a drop down select menu and text input box that appear alongside each file in the upload queue. These can be filled after files are uploaded, and updated form data sent after clicking off the text box etc.\r\n\r\nSo far I have edited index.html and added:\r\n\r\n    <td><b>Package:</b> \r\n    <select name=\"package[]\"><option value=\"0\">Basic</option><option value=\"1\">Advanced</option><option value=\"2\">Restoration</option></select>\r\n    </td>\r\n    <td>\r\n    <input type=\"text\" name=\"notes[]\">\r\n    </td>\r\n\r\nafter the 'Delete' button code, and moved the closing form tag to after the template-upload script to include these fields in the form.\r\n\r\nThat's not a ton of progress. I'd like the menu selection and text box data for each file to be stored in a generated text/xml/etc file, together with the corresponding filenames, in the upload folder with the photos. So as you can see I've created separate arrays a la the files array, which will be parsed in a similar way.\r\n\r\nThing is, I can't follow the chain of events. Where is that data accepted? Presumably I would have to make changes to upload.php, but file uploads are processed elsewhere and I'm not exactly sure how.\r\n\r\nI notice that people keep directing questions to this https://github.com/blueimp/jQuery-File-Upload/wiki/How-to-submit-additional-Form-Data but that appears to be an older version of the plugin, and I can't even find those code snippets in my files.\r\n\r\nCan anyone help me out with this? What sort of rudimentary code would I have to add to which files, to get this working?\r\n\r\nI'm sorry I know it's asking a lot, but I'm sort of a noob at jQuery etc. I've actually made the plugin work for myself and made little adaptations here and there, but this is completely beyond my scope.\r\n\r\nHere again is more of index.html:\r\n\r\n    <h2>File Upload</h2>\r\n    <div id=\"fileupload\">\r\n        <form action=\"upload.php\" method=\"POST\" enctype=\"multipart/form-data\">\r\n            <div class=\"fileupload-buttonbar\">\r\n                <label class=\"fileinput-button\">\r\n                    <span>Add files...</span>\r\n                    <input type=\"file\" name=\"files[]\" multiple>\r\n                </label>\r\n                <button type=\"submit\" class=\"start\">Start upload</button>\r\n                <button type=\"reset\" class=\"cancel\">Cancel upload</button>\r\n                <button type=\"button\" class=\"delete\">Delete files</button>\r\n            </div>\r\n    \r\n        <div class=\"fileupload-content\">\r\n            <table class=\"files\"></table>\r\n            <div class=\"fileupload-progressbar\"></div>\r\n        </div>\r\n    </div>\r\n    <script id=\"template-upload\" type=\"text/x-jquery-tmpl\">\r\n        <tr class=\"template-upload{{if error}} ui-state-error{{/if}}\">\r\n            <td class=\"preview\"></td>\r\n            <td class=\"name\">${name}</td>\r\n            <td class=\"size\">${sizef}</td>\r\n            {{if error}}\r\n                <td class=\"error\" colspan=\"2\">Error:\r\n                    {{if error === 'maxFileSize'}}File is too big\r\n                    {{else error === 'minFileSize'}}File is too small\r\n                    {{else error === 'acceptFileTypes'}}Filetype not allowed\r\n                    {{else error === 'maxNumberOfFiles'}}Max number of files exceeded\r\n                    {{else}}${error}\r\n                    {{/if}}\r\n                </td>\r\n            {{else}}\r\n                <td class=\"progress\"><div></div></td>\r\n                <td class=\"start\"><button>Start</button></td>\r\n            {{/if}}\r\n            <td class=\"cancel\"><button>Cancel</button></td>\r\n        </tr>\r\n    </script>\r\n    <script id=\"template-download\" type=\"text/x-jquery-tmpl\">\r\n        <tr class=\"template-download{{if error}} ui-state-error{{/if}}\">\r\n            {{if error}}\r\n                <td></td>\r\n                <td class=\"name\">${name}</td>\r\n                <td class=\"size\">${sizef}</td>\r\n                <td class=\"error\" colspan=\"2\">Error:\r\n                    {{if error === 1}}File exceeds upload_max_filesize (php.ini directive)\r\n                    {{else error === 2}}File exceeds MAX_FILE_SIZE (HTML form directive)\r\n                    {{else error === 3}}File was only partially uploaded\r\n                    {{else error === 4}}No File was uploaded\r\n                    {{else error === 5}}Missing a temporary folder\r\n                    {{else error === 6}}Failed to write file to disk\r\n                    {{else error === 7}}File upload stopped by extension\r\n                    {{else error === 'maxFileSize'}}File is too big\r\n                    {{else error === 'minFileSize'}}File is too small\r\n                    {{else error === 'acceptFileTypes'}}Filetype not allowed\r\n                    {{else error === 'maxNumberOfFiles'}}Max number of files exceeded\r\n                    {{else error === 'uploadedBytes'}}Uploaded bytes exceed file size\r\n                    {{else error === 'emptyResult'}}Empty file upload result\r\n                    {{else}}${error}\r\n                    {{/if}}\r\n                </td>\r\n            {{else}}\r\n                <td class=\"preview\">\r\n                    {{if thumbnail_url}}\r\n                        <a href=\"${url}\" target=\"_blank\"><img src=\"${thumbnail_url}\"></a>\r\n                    {{/if}}\r\n                </td>\r\n                <td class=\"name\">\r\n                    <a href=\"${url}\"{{if thumbnail_url}} target=\"_blank\"{{/if}}>${name}</a>\r\n                </td>\r\n                <td class=\"size\">${sizef}</td>\r\n                <td colspan=\"2\"></td>\r\n            {{/if}}\r\n            <td class=\"delete\">\r\n                <button data-type=\"${delete_type}\" data-url=\"${delete_url}\">Delete</button>\r\n            </td>\r\n    <td><b>Package:</b> \r\n    <select name=\"package[]\"><option value=\"0\">Basic</option><option value=\"1\">Advanced</option><option value=\"2\">Restoration</option></select>\r\n    </td>\r\n    <td>\r\n    <input type=\"text\" name=\"notes[]\">\r\n    </td>\r\n        </tr>\r\n    </script>\r\n        </form>\r\n    <script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js\"></script>\r\n    <script src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js\"></script>\r\n    <script src=\"//ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js\"></script>\r\n    <script src=\"../jquery.iframe-transport.js\"></script>\r\n    <script src=\"../jquery.fileupload.js\"></script>\r\n    <script src=\"../jquery.fileupload-ui.js\"></script>\r\n    <script src=\"application.js\"></script>","comments":12,"title":"submitting extra form data with file uploads","updated_at":"2011-10-19T22:37:16Z","url":"https://api.github.com/repos/blueimp/jQuery-File-Upload/issues/628","id":1680816,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/d0541dde501208504967ff60d6cf639a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d0541dde501208504967ff60d6cf639a","url":"https://api.github.com/users/morgjp","id":1059177,"login":"morgjp"},"html_url":"https://github.com/blueimp/jQuery-File-Upload/issues/628","labels":[],"state":"open"},"legacy":{"issue_id":1680816,"comment_id":2462366}}