通过FTP在安全模式下传输修改后的文件?

I have a list of existing files that need to follow these steps:

  1. Stored in a temporary file
  2. Modified
  3. Transferred to another server via FTP. All while the server is running in safe mode.

I can't use tmpfile(), because I still wouldn't be able to modify it, before sending it off.

Anyone come across this kind of problem and find a solution? Any ideas at all?

Beforehand, create a temporary directory owned by the user under which PHP runs.

At run time, create a file in that directory. Put some stuff into its contents. Now you have your temporary file. Finally, send it off via FTP. No problem there.