Solved

In Need of: HTTPS File Upload Script

Posted on 2010-08-23
8
329 Views
Last Modified: 2013-12-13
I am in need of a simple script (.php, .asp) that can send an .xml file to a remote server.
I am transmitting orders to a customer, they require https communication (no ftp), the proper certificates are in place.
Basically, I want to drop a file into a directory on my server and have the script automatically grab the file and send it to a url (their server).
So far, everything I have found requires a form to submit the data.  I cannot use an upload form, the files are dropped in the directory automatically from our warehouse management system.

Can someone point me in the right direction?

Thanks!
0
Comment
Question by:medennis
8 Comments
 
LVL 9

Expert Comment

by:Snarfles
ID: 33502883
Do you have a ssh connection on both machines? if so you could create a ssh connection from your box to theirs and then use scp to copy the file over. You can just create a perl script to do that and then assign it as a cron job.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33502975
You have to know how they are going to 'receive' the file.  If they are expecting a 'POST' with a file, then you will have to do it that way or it won't be received.
0
 

Author Comment

by:medennis
ID: 33510752
Yes Dave, they are expecting the file via HTTPS POST.
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 33512545
One of your options is using 'curl' in PHP to POST the file to the server.  http://us.php.net/manual/en/book.curl.php  PHP is not normally run in the background as a task but you could set up a periodic task in "Scheduled Tasks" to run it from the command line.  I don't have a script to do what you want but it's probably available.  Is this a Windows or Linux or Mac machine?
0
 

Author Comment

by:medennis
ID: 33514924
It is a Windows Server 2003 using IIS; PHP is installed and working properly on this box.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 33515879
This page appears to have all the pieces, just not put together as you need.  Note the comments about some things not working on some version of PHP.
0
 

Expert Comment

by:jmichaelbrook
ID: 37206725
I am in need of a simple script (.php) that can send an.csv .xml file to a remote server.
I am transmitting orders to a customer, they require http communication (no ftp) and POST, the proper certificates are in place.
I am using shared hosting on a linux platform and intend to use a cron job to initiate the PHP script
Basically, I want to drop a file into a directory on my server and have the script automatically grab the file and send it to a url (their server).
So far, everything I have found requires a form to submit the data.  I cannot use an upload form, the files are dropped in the directory automatically from our warehouse management system.

Can someone point me in the right direction?

Thanks!
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 37208990
@jmichaelbrook, you need to open a new question instead tagging on a closed question.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now