Solved

In Need of: HTTPS File Upload Script

Posted on 2010-08-23
8
328 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
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…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

911 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

20 Experts available now in Live!

Get 1:1 Help Now