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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save post file to local disk?

Status
Not open for further replies.

4181944

Programmer
Aug 6, 2002
9
NZ
Hi,

Dose anyone know to implement this:

I have a post form include a file and pair of radio buttons (let user choose file saving location). If user select “save to remote”, the file need to be upload to remote server, when the user select “save to local” the file need to be saved into default hard drive in local network. No problem for me to implement upload file to remote server, how can I save this post file into local disk? I know PHP only execute in server side. Have any client side languages not rely on Microsoft technology can do this?

Any ideas or hints?

Thanks

Richard
 
Letme try clarify what you want a little:
If the file is on the local hard disk, you want the option to save it to the webserver?

you can do this.(See $_FILES array for uploads)

If the file is on the sever you want to save it to local hard disk?

you can do this too ? number of ways,fopen, fpassthru, fread etc.

If the file is local and you want to save it to somewere else local ?
File -> save as :)

er anything I'm missing ?


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Thank you for your reply.

Let me clarify more:

The code is:

<form action="savefile.php" method="post" enctype="multipart/form-data" name="form1">
<input type="file" name="efile"><BR>
<input type="radio" name="storage" value="remote" >Save To Web Server<BR>(maximum file size 50k)<BR>
<input type="radio" name="storage" value="local" >Save To Local Server (maximum file size 5M)<BR>
<input type="submit" name="Submit" value="Save">
</form>

End user uses this form browses a file from their local hard drive, then chooses saving location between webserver (which php file resident, irrelevant to end user’s network) and the default hard drive from their local area network.

My problem is:
If end user selected “Save To Local Server” and click “Submit” button, how can I save this post file into user’s default network hard drive? Assume user does not use “File -> Save as”.

Thanks
 
So if the user has a file on their c: drive, upload it to the webserver via php form, and you want to instruct the webserver to either keep the file or save it to a server local to the user?

are the webserver and the local server on the same network?

if so , are they both suitably protected by a good firewall?

if you answer yes to these questions, see shell_cmd(),exec(), or system() in the php manual, and rcp manual pages.

You will also need to understand login controls, pam authentication whereapplicable and host equivalence.

****** ALL Of the above is potential securtiy risk stuff, and some of it can break your servers if you don't understand what you are doing. Any breakage and/or adverse effects result in Rule Number 1.

Rule Number 1.
You break it, YOU fix it.

If after reading the above you think I understand your needs, and you want some more help, feel free to ask. At all times, rule number 1 applies.


______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Oh, if any answers are no, then you can't do it, as it would constitue a breach of security (which every script kiddie on the planet would love).

______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top