Jump to content

change file Remotly - Problem


hitesh

Recommended Posts

Programmers,

 

I have a problem regarding accessing a file remotly.

Can someone help me in that?

 

 

I'll explain my problem thru example.

 

Example :

 

My website is @ http://95.165.168.168/newsite/  this URL.

The file which I wanted to access is @ 92.168.165.153 this machine in c://reservation/new.xml location.

 

 

As you can see

1. My reservation file is on another machine

2. My webapplication is on another server.

 

Now I want my website / webapplication to change the file which is @

92.168.165.153 server. I have the Admin login information ie. username and password

of the this machine. I can able to connect 92.168.165.153 machin thru php FTP code, but

I can not able to change the file containts.

 

Can any one suggest me how can I achive this using php code.

 

Hitesh

Link to comment
https://forums.phpfreaks.com/topic/62433-change-file-remotly-problem/
Share on other sites

That will also do but in should be in following manner.

  • Read the Old file
  • Add new contains at the end of the Old file (should be done at the Web application server)
  • upload with a new name

 

is this Possible?

 

I have another question too. Was that code has to do anything with this problem?

 

 

 

 

  • 2 weeks later...

Oops I did it again... ;D

 

I actually Rename and modify the file only using FTP function.

for Rename

ftp_rename($conn_id, $local_file, $server_fille))

 

and for Modify

I copied the file on website Server using

  ftp_get($conn_id, $local_file, $server_file, FTP_BINARY,0))

 

and than put it back from where I have taken the File.

 

Any way

Thank you

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.