I have tryed for over 4 million years now to do this.. ARRRG! I am trying to make a upload script.. but something is wrong with it... Anything wrong with it? I guess the problem is: curl_setopt($ch, CURLOPT_POSTFIELDS, array(" [MAX_FILE_SIZE] => 157286400, [quick_upload_submit] => OK, [file] => array([name] => ".$_FILES['file']['name'].", [type] => ".$_FILES['file']['type'].", [tmp_name] => ".$_FILES['file']['tmp_name'].", [size] => ".$_FILES['file']['size'].") ")); ???? <form id="form_upload_submit" method="POST" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="157286400" /> <input type="file" name="file" id="file" size="14" /> <input type="submit" name="quick_upload_submit" value="OK" /> </form> <?php if($_POST){ $url = "http://www.wrzuta.pl/pliki/dodaj"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, array(" [MAX_FILE_SIZE] => 157286400, [quick_upload_submit] => OK, [file] => array([name] => ".$_FILES['file']['name'].", [type] => ".$_FILES['file']['type'].", [tmp_name] => ".$_FILES['file']['tmp_name'].", [size] => ".$_FILES['file']['size'].") ")); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $res = curl_exec($ch); echo $res; curl_close($ch); } ?> PHP: Thanks for your help dudes
Also out of interest.. with a upload of a file.. is there away to let me upload it from a URL not a file from my computer? Thanks again...
Hi, Have a look here, http://www.uploadphpscript.net/ this is a great tutorial for an upload script, worked for me 1st go and i never looked into making an upload script before.... Good luck
Thanks, but this is not what I need, I need the CURL uploader... To remotly upload to someones website...
I know there are 3rd party scripts, but that kind of programming is not my best area, only trying to help, Good Luck
as far as i'm aware, you don't use curl to process an incoming upload. it looks like you want to send a file from your pc to your php script. so you should use the $_FILES info on its own to process the posted form data. see the php.net site for an example upload script. if you wanted to upload a file that exists on your server, to another server, then you'd use curl.