?
Solved

In Need of: HTTPS File Upload Script

Posted on 2010-08-23
8
Medium Priority
?
334 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
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…
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…
Suggested Courses

801 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