Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.