cURL Upload Help
Posted on
16th Feb 2014 07:03 pm by
admin
OK, I am creating a bridge from a local program to my website and I am trying to find the best way to upload the client file from the local program (which is a CSV file) to my server. I was thinking I could use cURL to accomplish this feat. Basically the local program will invoke a batch file that opens my site with the path of the local file (which is the same file name and path everytime), then use cURL to upload that file to my server to be parsed and input into the database. Can this be done?
If so, I would have to just point the cURL to the .php file that would accept the uploaded file correct? And could I use POST for this with multi-form data and not PUT? Any input on this would be great, thanks.
Maybe something similar to this...
Code: $file='testWordDoc.doc';
Did you know?Explore Trending and Topic pages for more stories like this.
echo $file;
$ch = curl_init('http://myurl.com/recieve_posted.php');
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file'=>"@$file",'testkey'=>'test value'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
print "$postResult";
No comments posted yet
Your Answer:
Login to answer
223
45
Other forums
Take info from one coloum and move to another
Hi all,
I have this:
Code: [Select]$array = "SELECT stock_id FROM stocks WHERE stock_
help with this code please?
Hello,
I am trying to build a remote upload script for my image hosting site.
I am usi
SMTP server...
I recently found a tutorial online on SMTP authentification for sending emails from webpages, here i
PHP code needed to get/post form fields and request mysql query results.
I'm new to PHP
I've created an html form to allow the user to request a basic telephone dire
Beginner PHP code help
Hi I'm new to php but if someone could please read the question below and help it would be great.
urldecode question
How would I format this line of code properly?
<?php echo urldecode($_GET['Title']); ?
Syntax Help
Code:
im having trouble with that code snipped
Parse error: syntax error, unexpec
Slashes
Have a small problem and I'm not able to understand why I'm getting the results I'm getting... and i
OOP help
okay so i have a class im making it has everything setup i just need to randomize the 2 variables an
A Few Questions
Hi, I want to ask a few questions that I can't seem to find..
1) I'm creating a "shortcu