collective / collective/collective.quickupload
"typeupload" doesn't have effect when "Automatic upload on select" is enabled
- Dominant language
- Python
- Stars
- 6
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
From the back end I'm forcing a file type like this:
```
self.request['SESSION']['typeupload'] = 'RichFile'
```
So that when I upload a file, it is sent as RichFile, which is a custom type made for our project.
This works except when the option "Automatic upload on select" is enabled. Then, QuickUpload guesses the file type by itself instead of relying on typeupload.
Probably the file to look into is fileuploader.js. I worked around this problem by overriding the method qq.FileUploader.prototype._addFile defined in this file, replacing the line
```
this._queueUpload(id, this._options.params);
```
to
```
jQuery('#uploadify-upload').click();
```
which works for me but may not be a very clean solution.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in fileuploader.js at qq.FileUploader.prototype._addFile and inspect how automatic upload uses _queueUpload and the upload parameters. Reproduce the case with Automatic upload on select enabled and typeupload set to RichFile, then verify that the selected custom type is preserved without relying on the jQuery workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, python
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100