i am facing a weird problem. The scenario is that I have a folder that contains an image file. When the user upload another image file, then firstly the existing image file is renamed to x_Original.xxx and then the file to upload is uploaded(put) in the same directory with the name of the original file(the file that was renamed previously).
there is a file test.jpg in my ftp folder
now when i upload another file newtest.jpg the following steps are taken:
1. the old file test.jpg is rename as test_original.jpg ( this is working fine )
2. the new file is then put in the same folder, with the name test.jpg (i.e. the name of the old file) (this is creating a file with the name specified, but the filesize is 0kb and there is no content in the file).
The renaming is working flawlessly but when i put the new file after renaming old file, the new file is created but the contents of the image file are not saved. The new file that is created has 0kb size.
Can you please elaborate if I am doing something wrong, or if i need to change something in my code ?
Note : please note that i m using the same instance of ftp object both for renaming and uploading file..