Solved

Help with PHP upload...

Posted on 2008-06-18
4
209 Views
Last Modified: 2008-07-01
I need to transfer an existing file from "Server_A" to "Server_B" when web visitor clicks on a button inside a php page served by "Sever_A".

"Server_B" already has an ASP script that receives files via standard http post.

In fact, on "Server_A", we already have a page that allows users to choose a local file:

<FORM NAME="myform" METHOD=POST ENCTYPE="multipart/form-data" NAME="SENDFILE" ACTION="http://SERVER_B/upload.asp">
<input type=file name="file1">
<input type="submit" name="dosubmit" value="Send File" accept="image/jpg, image/gif">

So, I thought about this: <input type=file name="file1" VALUE="myfile.jpg"> but it didn't work.

Help!
0
Comment
Question by:frankmorrison
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:hernst42
ID: 21819567
IS that file onthe local computer of the user or on Server A?
If it's on the users computer then there i no way to have an default.
0
 
LVL 1

Author Comment

by:frankmorrison
ID: 21825198
The file is on Server_A.  I simply need a php script that will move a file from Server_A to Server_B.
0
 
LVL 48

Accepted Solution

by:
hernst42 earned 500 total points
ID: 21825230
You can use the curl extension to post files from server a to server be.
See example 2 on http://www.php.net/manual/en/function.curl-setopt.php
0
 
LVL 1

Author Comment

by:frankmorrison
ID: 21877885
hernst42

Are there any simple working samples you can give me?
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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

785 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