Search

upload attachment

Subscribe to upload attachment 1 post(s)

 
yc

I am having issue uploading attachments using Curl. Basically I have a file upload box in my form
(has enctype=“multipart/form-data”).

- get the file in php

$file = $_FILES[‘fileup’];

- assign tmp file path to a variable

$postbody = “@$file[tmp_name]”;

- setup postfields in curl
curl_setopt ($chandle, CURLOPT_POSTFIELDS, $postbody);

I have also set the 2 required headers as specified by the unfuddle api.

The issue is when I download the attachments instead of containing their original content, they only have the tmp file path ie what “$file[tmp_name]” points to

Any idea why that might be the case?