Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

tricky file upload situation

Status
Not open for further replies.

IDTstudios1

Programmer
Aug 8, 2004
72
US
I've been trying to figure this out for three days now and have had no luck so far. This is what i need the script to be able to do:

I need to be able to call a script like this:

upload.php?file=c:\test.xml

and have that script upload the file. You would think this would be easy but I just can't figure out how to do it.

I need upload.php to do all the work. I know how to load the info into a form and pass it off to another script but I want to eliminate the need for a form.

Any help would be great,
Thanks,
Andrew
 
You mean, point a browser on a workstation to that address and have the browser upload that file from the workstation to the server without further human intervention?



Want the best answers? Ask the best questions!

TANSTAAFL!!
 
yes, if it's possible. it's for an internal network so security really isn't a concern.
 
The only way I can think of doing that is if you have an FTP server running on each PC. Then you could use FTP with PHP to grab the file.

Ken
 
This is not possible using solely PHP, as PHP runs on the server. It would have no way to touch a workstation's filesystem.

You might be able to use a combination of PHP and a client-side scripting language. The PHP would use the input on the command-line and output a form and sufficient client-side code to make it all happen automatically.

I hope it's not possible at all, though, from a general security standpoint.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Thanks for the help. I think I know how to pull this off using a bit of Java on the client side.
 
Actually, I believe it is possible, since the FTP functions built into PHP can make it act as an FTP Client and connecting to the FTP Server on each PC.

See

Ken
 
hmm, FTP might just work. I can always code a very simple FTP server in VB and have it run in the background.

Thanks,
Andrew
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top