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

Multi form-data issues #9

Open
gitaccxz opened this issue Nov 7, 2021 · 2 comments
Open

Multi form-data issues #9

gitaccxz opened this issue Nov 7, 2021 · 2 comments

Comments

@gitaccxz
Copy link

gitaccxz commented Nov 7, 2021

This data how to send?

$BODY .= '------WebKitFormBoundary'.$BOUNDARY.$eol;
$BODY .= 'Content-Disposition: form-data; name="file"; filename="'.basename($cp).'"'.$eol;
$BODY .= 'Content-Type: image/'.pathinfo(basename($cp), PATHINFO_EXTENSION).$eol.$eol;
$BODY .= $Pic.$eol; 

Trying like this:

$request->addPostFile('file', $cp, basename($cp));
$request->addPostField('Content-Type', 'image/'.pathinfo(basename($cp), PATHINFO_EXTENSION));

Name field: file
Filename: how to add?
2nd Line Content-Type: How to add?
$Pic: image how to add?

@hightman
Copy link
Owner

hightman commented Nov 7, 2021 via email

@emma-eva
Copy link

emma-eva commented Nov 8, 2021

I tried but pic not uploaded

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

3 participants