mikromundo Posted November 19, 2022 Share Posted November 19, 2022 @Sherzod can you help me with this ? Why when loading a second file, the first one is deleted? I tried several configurations of UniFileUpload but with no success. UniFileUpload.mp4 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 19, 2022 Share Posted November 19, 2022 15 minutes ago, mikromundo said: Why when loading a second file, the first one is deleted? Hello, I couldn't reproduce. Which build are you using? Can you test this in a new empty project? Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 19, 2022 Author Share Posted November 19, 2022 oCam-video_2022_11_19_15_00_52_122.mp4 as u can see. I upload a file and when I upload another one, the first one is removed. UniUpload.rar Quote Link to comment Share on other sites More sharing options...
artem_niko Posted November 21, 2022 Share Posted November 21, 2022 On 11/20/2022 at 1:04 AM, mikromundo said: oCam-video_2022_11_19_15_00_52_122.mp4 12.25 MB · 0 downloads as u can see. I upload a file and when I upload another one, the first one is removed. UniUpload.rar 47.94 kB · 0 downloads Hello! Try check this property in UniFileUploadButton: Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 21, 2022 Author Share Posted November 21, 2022 sorry the delay @artem_niko but yes my friend, I´ve tryed too. I don't want the files to be deleted, I want every file that was uploaded to remain in the folder. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 22, 2022 Share Posted November 22, 2022 @mikromundo Hello, I have modified your code: \FMSoft\Framework\uniGUI\Demos\Desktop\FileUpload procedure TMainForm.UniFileUploadCompleted(Sender: TObject; AStream: TFileStream); var //cFile : string; DestName : string; DestFolder : string; begin //edSearch30.Text := AStream.FileName; //cFile := ExtractFileName( AStream.FileName ); DestFolder := (Sender as TUniFileUpload).TargetFolder; DestName := DestFolder + ExtractFileName((Sender as TUniFileUpload).FileName); edSearch30.Text := 'File Name: ' + AStream.FileName; CopyFile(PChar(AStream.FileName), PChar(DestName), False); end; Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 22, 2022 Author Share Posted November 22, 2022 Thanks @Sherzodbut do not work yet. I have tried this tip too before. as you can see in the video, when loading the second file, the first one is removed. oCam-video_2022_11_22_08_02_42_287.mp4 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 22, 2022 Share Posted November 22, 2022 I have tested on your testcase, works. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 22, 2022 Author Share Posted November 22, 2022 I fix this: but still not working. my unigui version is .1559. UniUpload.rar Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 24, 2022 Author Share Posted November 24, 2022 @Sherzod Sorry to bother you again, but did you test the project I sent you in the last post? I can't get the expected result. It is worth remembering that this problem occurred with several users (not just me) and I am trying to find out if the problem is mine or a bug in unigui. I haven't migrated my unigui version yet (I'm still using the final version .1559 ). Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2022 Share Posted November 24, 2022 @mikromundo We will check this issue once again. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 24, 2022 Author Share Posted November 24, 2022 5 hours ago, Sherzod said: @mikromundo We will check this issue once again. @Sherzod Sorry to bother you again, but did you test the project I sent you in the last post? I can't get the expected result. It is worth remembering that this problem occurred with several users (not just me) and I am trying to find out if the problem is mine or a bug in unigui. I haven't migrated my unigui version yet (I'm still using the final version .1559 ). Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 24, 2022 Author Share Posted November 24, 2022 I update my unigui version to .1564 and the issue continues. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 25, 2022 Share Posted November 25, 2022 @mikromundo Hello, Can you try this approach? ... CopyFile(PChar(AStream.FileName), PChar(DestName), False); (Sender as TUniFileUpload).Files[0].Stream := Nil; //<------- ... 1 Quote Link to comment Share on other sites More sharing options...
mikromundo Posted November 25, 2022 Author Share Posted November 25, 2022 6 hours ago, Sherzod said: @mikromundo Hello, Can you try this approach? ... CopyFile(PChar(AStream.FileName), PChar(DestName), False); (Sender as TUniFileUpload).Files[0].Stream := Nil; //<------- ... Perfect !!! Now it worked. Quote Link to comment Share on other sites More sharing options...
mikromundo Posted March 6 Author Share Posted March 6 @Sherzod I noticed that when you add a file that already exists in the destination folder, the new file receives a numerical sequence. Ex: Existing file: File.pdf New upload of the same file: File1.pdf If I check the "overwrite" property, an exception is generated warning that the file is being used by another process. Is it possible to check this Sherzod? Quote Link to comment Share on other sites More sharing options...
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.