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!

Sending images

Status
Not open for further replies.

rastkocvetkovic

Programmer
Aug 11, 2002
63
SI
Regards!

With a little bit of help of our Tek-tips forums I've managed to transfer data from one server to another. Now I'm trying to transfer images - from server1.com to server2.com.
I already have HTML forms (input="file") that can upload the picture to server2.com, but I want this to be done automatically.
Therefore I've tried JAVASCRIPT:
I tried to manually javascript the values of this file-input-types - like <input name=&quot;image[]&quot; type=&quot;file&quot; value=&quot;<?=$path_to_image[$i]?>> and hide them into an invisible layer in <form><invisible layer><submit button></form>, but the the 'type=&quot;file&quot;' can't get values with 'value=&quot;something&quot;'... (eg. 'value=&quot;c:\something.jpg&quot;')

Should I try BINARY TRANSMISSION with fopen and fclose?
I surely don't want to use FTP due to security risks (password will be shown in the code).

Thank you for your tips on this.
 
FTP is enabled, yes.
But the password would exist in the PHP code, wouldn't it. That's a huge problem, because the directories in which files will be uploaded to, will be created dinamically - also with PHP. Therefore I think, I couldn't set a FTP access just for those directorie due to the fact I even don't know how will they be named. Maybe there's a possibility of excluding all other files or even setting permissions for upload during dinamical creation of them, but I'm indeed a stranger to linux+apache security settings and I don't know how to do that. Help would be needed there, thank you!
 
I'm not getting a clear picture of what you're trying to do.

Are you trying to keep the directory trees of the two servers syncronized as users upload files? ______________________________________________________________________
TANSTAAFL!
 
Hmm, I'll try to describe the situation directly as I can.

I'm making webpages for local restaurants, and therefore every restaurant that subscribes to our service, receives a web page of tipe masterserver.com/restaurants_name/. A people who are selling the service, have notebooks running Apache: in which .jpg photos are stored.
After the seller has returned to office, he clicks upload all restaurant/photos and a script should create the same directories on the master server (eg. and copy all new photos into their photos directory.

Just a note: in a simple file named index.php with $restaurants_id is created which then manages content from the database. (That already works).

Now, the problem is that the seller could have access to root of the (in which vital web-pages are stored), if he knew FTP username and password, which is in the PHP source, therefore I don't want the script to use FTP access.

I hope the situation is much clearer now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top