Solved

In Need of: HTTPS File Upload Script

Posted on 2010-08-23
8
327 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 82

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 82

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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 82

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 82

Expert Comment

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
This article discusses how to create an extensible mechanism for linked drop downs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to dynamically set the form action using jQuery.

747 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