mos Posted July 1, 2020 Posted July 1, 2020 I am using a TUniFileUploadButton to upload images and when the OnCompleted event is called I need to rename the file. The problem I have is that the RenameFile is failing and when I use Windows Explorer to go to the directory to try and delete the file, Windows reports that the file is in use by my application. Therefore it would seem like the file is being locked by my application once the upload has completed and only after shutting down my app can I delete or rename it. I also tested this using the fupload demo app and again the file seems to be locked. I am using build 1534. Quote
mos Posted July 1, 2020 Author Posted July 1, 2020 Hi Sherzod, All you need to do is run the following demo: Framework\uniGUI\Demos\Desktop\FileUpload - Button Set the TargetFolder. Then run the app and once the upload has completed go to the Target Folder using Windows Explorer and try and delete the file. Quote
mos Posted July 2, 2020 Author Posted July 2, 2020 Hi Sherzod, Any update on this? I have attached a test app which has a Target Folder = Testing and I have code in the OnComplete event which tries to rename the file but fails. If you try and delete the file using Windows Explorer it says the file is in use. UploadIssue.zip Quote
Sherzod Posted July 2, 2020 Posted July 2, 2020 2 hours ago, mos said: I have attached a test app which has a Target Folder = Testing and I have code in the OnComplete event which tries to rename the file but fails. Hi, Sorry for the late response. Yes, I see. We will check it. Quote
mos Posted July 3, 2020 Author Posted July 3, 2020 Hi Sherzod, I have fixed this issue by freeing off the FileStream parameter and now the RenameFile works. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.