Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found bug in code #34

Open
lamao opened this issue May 6, 2013 · 1 comment
Open

Found bug in code #34

lamao opened this issue May 6, 2013 · 1 comment

Comments

@lamao
Copy link

lamao commented May 6, 2013

Faced with error with 'qqfile' parameter sending to server . Spent some time comparing my old version of file and the newest one.
fileupload.js, line 1352. Now it is
formData.append(name, file);

but must be
formData.append(this._options.inputName, file);

because in onld code it was
formData.append('qqfile', file); and this._options.inputName means qqfile by default.

@KoulSlou
Copy link

@lamao Hi, I faced with the same problem. When I set encoding field to "multipart" uploader is not working and I receive message:

"Could not save uploaded file.The upload was cancelled, or server error encountered"

After some investigation, I understood that the problem is in index of $_FILES array. In constructor when script decide which type of uploader should be initialized (qqUploadedFileForm or qqUploadedFileXhr) index "qqfile" is checked in $_FILES. But there is no element with such index. And the problem in file upload.js in this code

if (this._options.encoding == 'multipart') {
        var formData = new FormData();
        formData.append(name, file);
        file = formData;
}

I just change formData.append(name, file); to formData.append("qqfile", file).

I'm not very confident in js and I appreciate any comments on this issue from plugin developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants