Skip to content

Instantly share code, notes, and snippets.

@pulpfree
Created May 6, 2014 13:15
Show Gist options
  • Select an option

  • Save pulpfree/6bcd4f63ae7a96f7a64a to your computer and use it in GitHub Desktop.

Select an option

Save pulpfree/6bcd4f63ae7a96f7a64a to your computer and use it in GitHub Desktop.
apigiility file upload output
The $data var in POST (create) returns:
stdClass Object
(
[field_name] => slide_image
[file_type] => image/jpeg
[file_resize] => {"width":900,"height":700}
[name] => aaa
[caption] => aaa
[slideshow_id] => 53501394499c13a204d63af2
)
whereas the same $data var (after adding the multipart/form-data) in PUT (update) returns the Request Payload:
stdClass Object
(
[------WebKitFormBoundary6jWImBh90tl8U2YC
Content-Disposition:_form-data;_name] => "field_name"
slide_image
------WebKitFormBoundary6jWImBh90tl8U2YC
Content-Disposition: form-data; name="file_type"
image/jpeg
...
------WebKitFormBoundary6jWImBh90tl8U2YC
Content-Disposition: form-data; name="slide_image"; filename="jpg-1280x1024_hd-forty-eight.jpg"
Content-Type: image/jpeg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment