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

curl now can uploading file with ',' or ';' in filename. #55

Closed
wants to merge 4 commits into from

Conversation

ulion
Copy link
Contributor

@ulion ulion commented Jan 17, 2013

original patch is at http://sourceforge.net/p/curl/bugs/1171/
here's the updated one, with docs, and test cases.

this commit will make curl support http form uploading file with ',' or ';' in its filename, by support parse double-quotes around the file and filename part.
Which does not change the behavior of curl of any existed external usage, just support parse file and filename which is well quoted, if the caller does quoting the file or the filename part..

@ulion
Copy link
Contributor Author

ulion commented Jan 20, 2013

updated, now can handle filename contains both '"', ',', ';'.
libcurl also updated to send correct escaped filename to http server.

test cases may related:

test 009...[HTTP RFC1867-type formposting]
-d-p--e-v OK (1   out of 14 , remaining: 01:18)
test 071...[HTTP and -F upload in config file]
-d-p--e-v OK (2   out of 14 , remaining: 00:52)
test 044...[HTTP RFC1867-type formposting without Expect: header]
-d-p--e-v OK (3   out of 14 , remaining: 00:38)
test 041...[HTTP formpost with missing file]
------e-v OK (4   out of 14 , remaining: 00:29)
test 039...[HTTP RFC1867-type formposting with filename= and type=]
-d-p--e-v OK (5   out of 14 , remaining: 00:26)
test 304...[HTTPS multipart formpost]
-d-p--e-v OK (6   out of 14 , remaining: 00:29)
test 259...[HTTP POST multipart with Expect: header using proxy anyauth (Digest)]
-d-p--e-v OK (7   out of 14 , remaining: 00:26)
test 258...[HTTP POST multipart without Expect: header using proxy anyauth (Digest)]
-d-p--e-v OK (8   out of 14 , remaining: 00:21)
test 173...[HTTP RFC1867-formpost a file from stdin with "faked" filename]
-d-p--e-v OK (9   out of 14 , remaining: 00:17)
test 166...[HTTP formpost a file with spaces in name]
-d-p--e-v OK (10  out of 14 , remaining: 00:13)
test 1404...[HTTP RFC1867-type formposting - -F with three files, one with explicit type]
-d-p-oe-v OK (11  out of 14 , remaining: 00:10)
test 1315...[HTTP RFC1867-type formposting - -F with three files, one with explicit type]
-d-p--e-v OK (12  out of 14 , remaining: 00:06)
test 1133...[HTTP RFC1867-type formposting with filename contains ',', ';', '"']
-d-p--e-v OK (13  out of 14 , remaining: 00:03)
test 1053...[HTTP RFC1867-type formposting from file with Location: following]
-d-p--e-v OK (14  out of 14 , remaining: 00:00)
TESTDONE: 14 tests out of 14 reported OK: 100%
TESTDONE: 14 tests were considered during 47 seconds.

@ulion ulion closed this Jan 25, 2013
@lock lock bot locked as resolved and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant