Uploading via SFTP over slow connection to temporary location then moving to real location

StackOverflow https://stackoverflow.com/questions/12079781

  •  27-06-2021
  •  | 
  •  

Question

I have an issue where occasionally I need to work at Starbucks.

When I upload a PHP file the connection is slow so if a user tries to access the PHP file while I am uploading it they will of course be issues a fatal error.

This is very inconvenient to my busy websites. Is there a way that when a file is uploaded it can be uploaded to a temporary location, and then the server moves it to the real location once finished?

Was it helpful?

Solution

You can make WinSCP upload the file to temporary file and rename it once transfer completes automatically.

In Preferences go to the Transfer > Endurance tab and select All Files in the Enable ... Transfer to temporary file name box.

For details refer to:
https://winscp.net/eng/docs/ui_pref_resume

OTHER TIPS

Why don't you just upload the file to a temporary folder on the server and execute commands on the server to remove the old file and move the new file? It should move the file fast enough on the server to eliminate any hiccups the users would see unless their timing was just right.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top