Skip to content
This repository has been archived by the owner on Nov 20, 2018. It is now read-only.

pass params by method post #113

Closed
ubiq-zz opened this issue Feb 28, 2011 · 18 comments
Closed

pass params by method post #113

ubiq-zz opened this issue Feb 28, 2011 · 18 comments
Milestone

Comments

@ubiq-zz
Copy link

ubiq-zz commented Feb 28, 2011

i googled much time, but no answer. my problem that file-uploader add params to url, not pass them by post.
for example
action:'/upload.php'
params : { x1:'x1'}

so it will submit to url /upload.php?x1=x1(get), but i need to pass additional params by post. is this possible?

@valums valums closed this as completed Jun 22, 2011
@stephencarr
Copy link

I'd like to understand if this is possible also, seems the issue was closed without comment.

@thomask
Copy link

thomask commented Nov 6, 2011

Same here!

@rnicholus
Copy link
Member

Why is it useful to send a second request with the parameters? The parameters are already sent with the upload request.

@jpoehls
Copy link

jpoehls commented Oct 23, 2012

I'd like more details on this as well since I just ran into a use case where this is causing a problem in our app. Our backend expects the parameters to be in the POST body, not in the URL. After a brief look at the file-uploader code it appears that this would be very easily doable. Can you please confirm whether this is doable or not, @valums?

@rnicholus
Copy link
Member

@jpoehls Andrew Valums is no longer working on this project. I have taken over.

If you want the parameters to be present in the request instead of the query string, the request must be multipart encoded. Currently, you can force the XHR upload request to use this encoding (see the forceMultipart option), but all parameters are part of the query string. It would not be hard to simply add all parameters to the FormData object if an XHR upload request is possible. As far as uploads in browsers that do not support the File API, such as IE, we would need to dynamically build input elements in the associated form for each parameter.

If this functionality is added, it would need to be tied to an option, and would default to the current behavior (params in the query string).

@rnicholus rnicholus reopened this Oct 23, 2012
@rnicholus
Copy link
Member

I've scheduled this as an enhancement for the 3.3 milestone. If I receive a bunch of comments from current users who would like to see this sooner, I can move it to an earlier milestone.

@jpoehls
Copy link

jpoehls commented Oct 24, 2012

Sounds good. I'm just trying to pass a CSRF token. I tried using a custom header but of course that doesn't work in IE and I don't want to pass it in the QueryString.

@sebastiansulinski
Copy link

I'd also appreciate if that could be added. Many thanks.

@rnicholus
Copy link
Member

Scheduled for 3.3 at this point.

@ghost
Copy link

ghost commented Nov 22, 2012

we are all waiting for 3.3 :D

@rnicholus
Copy link
Member

@blakie The beauty of github lies in the ability to submit proposed changes to a project's code in the form of a pull request. Feel free to contribute this yourself if you'd like it completed sooner. Otherwise, i'll have to do my best and fit it in to the 1.5 hours off free time i have every night or so. If a bunch of people comment on this issue after my post, i can certainly consider moving it into an earlier release as well...

@vm370
Copy link

vm370 commented Nov 23, 2012

This is definitely needed due to simple fact that modern perl CGI module many years just skip url params in POST requests.
So every time you need to patch CPAN CGI module by hand or add lines of code to perl script to handle this.

@ghost
Copy link

ghost commented Nov 23, 2012

@rnicholus I just wrote a quick and dirty patch. In the next days I will submit the pul request.

@rnicholus
Copy link
Member

Does this patch address the xhr AND the form uploader?
On Nov 23, 2012 3:58 AM, "Paolo Lunazzi" notifications@github.com wrote:

@rnicholus https://github.com/rnicholus I just wrote a quick and dirty
patch. In the next days I will submit the pul request.


Reply to this email directly or view it on GitHubhttps://github.com/valums/file-uploader/issues/113#issuecomment-10654722.

@ghost
Copy link

ghost commented Nov 23, 2012

quick and dirty meant that it fixed only my urgency (read: form uploader).
I will work on it to fix even xhr uploader.

On Fri, Nov 23, 2012 at 2:39 PM, Ray Nicholus notifications@github.comwrote:

Does this patch address the xhr AND the form uploader?
On Nov 23, 2012 3:58 AM, "Paolo Lunazzi" notifications@github.com
wrote:

@rnicholus https://github.com/rnicholus I just wrote a quick and
dirty
patch. In the next days I will submit the pul request.


Reply to this email directly or view it on GitHub<
https://github.com/valums/file-uploader/issues/113#issuecomment-10654722>.


Reply to this email directly or view it on GitHubhttps://github.com/valums/file-uploader/issues/113#issuecomment-10659732.

@rnicholus
Copy link
Member

The xhr fix is quite easy. Form uploader is another story. Also, sending
parameters in the body of the request will need to be controlled by an
option, and by default, this option must be off, since fine uploader has
always sent params in the query string.
On Nov 23, 2012 7:45 AM, "Paolo Lunazzi" notifications@github.com wrote:

quick and dirty meant that it fixed only my urgency (read: form uploader).
I will work on it to fix even xhr uploader.

On Fri, Nov 23, 2012 at 2:39 PM, Ray Nicholus notifications@github.comwrote:

Does this patch address the xhr AND the form uploader?
On Nov 23, 2012 3:58 AM, "Paolo Lunazzi" notifications@github.com
wrote:

@rnicholus https://github.com/rnicholus I just wrote a quick and
dirty
patch. In the next days I will submit the pul request.


Reply to this email directly or view it on GitHub<
https://github.com/valums/file-uploader/issues/113#issuecomment-10654722>.


Reply to this email directly or view it on GitHub<
https://github.com/valums/file-uploader/issues/113#issuecomment-10659732>.


Reply to this email directly or view it on GitHubhttps://github.com/valums/file-uploader/issues/113#issuecomment-10659857.

@rnicholus
Copy link
Member

Since this is becoming a popular request. I'll make this my next feature to tackle after adding the ability to upload directories (#380).

@rnicholus
Copy link
Member

This much-request feature has now been implemented in the 3.1 branch. See the associated blog post for more details.

rnicholus pushed a commit that referenced this issue Dec 5, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants