Results 1 to 9 of 9
-
21st Aug 2011, 04:02 AM #1OPMember
CURL - postfields how to replicate these headers
Code:-----------------------------30870195987994 Content-Disposition: form-data; name="file[]"; filename="" Content-Type: application/octet-stream -----------------------------30870195987994 Content-Disposition: form-data; name="file[]"; filename="K43TA206.zip" Content-Type: application/zip
In the rapidleech plugin, they open a socket and literally just paste that exact section. For curl I pass in an array format usually.
array ( "file[]" => "@$filename");
I've tried
PHP Code:array ( "file[]" => "", "file[]" => "@$filename" )
futureawesome Reviewed by futureawesome on . CURL - postfields how to replicate these headers -----------------------------30870195987994 Content-Disposition: form-data; name="file"; filename="" Content-Type: application/octet-stream -----------------------------30870195987994 Content-Disposition: form-data; name="file"; filename="K43TA206.zip" Content-Type: application/zip So I'm trying to write a basic curl upload script for bitshare. I know there is a rapidleech plugin for it, but I'm just wondering how do I pass the empty file as a post field. Bitshare is weird in that Rating: 5
-
22nd Aug 2011, 05:59 AM #2MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comtry
PHP Code:"file[]=&file[]={@$filename}"
JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
23rd Aug 2011, 06:23 AM #3MemberWebsite's:
ExploringPC.com DedicatedSeedboxHosting.com
-
23rd Aug 2011, 07:46 AM #4Respected Developer
you have to send 2 variables in your post array, one with filename and other with location, here is example for bitshare.
PHP Code:$postData = array(
'APC_UPLOAD_PROGRESS' => $progress_key,
'APC_UPLOAD_USERGROUP' => $usergroup_key,
'UPLOAD_IDENTIFIER' => $progress_key,
'file[]"; filename="' => basename($filelocation),
'file[]' => $filelocation
);
Bots Development | Web Development | Wordpress Customization | PSD Conversion
Life has many twists and turns in it, you have to take what you are given and use it for the best.
-
24th Aug 2011, 01:51 AM #5OPMember
Do I append this to the postdata array?
What happens to the usual @ infront of the file?
Thanks for your suggestions!
EDIT: I've tried what mRaza suggested and this is the headers returned from CURL.
Code:HTTP/1.1 100 Continue HTTP/1.1 200 OK Server: nginx/0.8.50 Date: Wed, 24 Aug 2011 02:38:25 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: close X-Powered-By: PHP/5.3.0 no files
-
24th Aug 2011, 03:02 AM #6MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comDo I append this to the postdata array?JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
-
24th Aug 2011, 03:31 AM #7OPMember
Oh so in the form of a GET?
So when i post with just
PHP Code:$post = "file[]=&file[]={@$x}";
The header returned is:
Code:HTTP/1.1 200 OK Server: nginx/0.8.50 Date: Wed, 24 Aug 2011 03:34:12 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: close X-Powered-By: PHP/5.3.0 wrong parameter count
PHP Code:$post = "APC_UPLOAD_PROGRESS={$progress_key}&APC_UPLOAD_USERGROUP={$usergroup_key}&UPLOAD_IDENTIFIER={$progress_key}&file[]=&file[]={@$x}";
Code:HTTP/1.1 200 OK Server: nginx/0.8.50 Date: Wed, 24 Aug 2011 03:38:07 GMT Content-Type: text/html Transfer-Encoding: chunked Connection: close X-Powered-By: PHP/5.3.0 Notice: Undefined index: file in /var/www/fs/x/upload.php on line 18 no files
-
24th Aug 2011, 05:29 AM #8Respected Developer
you have to add @ in file location:
PHP Code:$postData = array(
'APC_UPLOAD_PROGRESS' => $progress_key,
'APC_UPLOAD_USERGROUP' => $usergroup_key,
'UPLOAD_IDENTIFIER' => $progress_key,
'file[]"; filename="' => basename($filelocation),
'file[]' => "@$filelocation"
);
Bots Development | Web Development | Wordpress Customization | PSD Conversion
Life has many twists and turns in it, you have to take what you are given and use it for the best.
-
24th Aug 2011, 11:41 AM #9MemberWebsite's:
tehMoviez.com 0Senes.com GeekFaceGames.comOh so in the form of a GET?JokerHacker Blog
JokerHacker PHP coding Service // back again!
CurlAxel PHP Download Accelerator
hardly remembering the milk :p
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
how to add Expires headers - Help !
By prateek in forum Web Development AreaReplies: 7Last Post: 1st Apr 2012, 03:46 PM -
Need Logo and Headers for theBangBros.org [PAID]
By dawinet in forum Graphics AreaReplies: 13Last Post: 13th Mar 2012, 12:18 PM -
Http headers php script!
By inside7 in forum Web Development AreaReplies: 1Last Post: 11th Nov 2011, 12:48 PM -
OVH UK - Kernel Headers
By EvilGenius in forum Technical Help Desk SupportReplies: 0Last Post: 1st May 2011, 02:55 PM -
Adding Expiry Headers
By EnCiPh3r in forum vBulletinReplies: 3Last Post: 20th Jan 2011, 07:41 AM
themaManager - edit and manage...
Version 4.04 released. Open older version (or...