Gustavo.deo Posted April 7, 2018 Share Posted April 7, 2018 Hi.. I need to get the path of a file so I can read it on the system... How to get the full file path through fileupload??? Thanks.. Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted April 7, 2018 Share Posted April 7, 2018 You get no path info on a file upload in browser. Quote Link to comment Share on other sites More sharing options...
mika Posted April 9, 2018 Share Posted April 9, 2018 uniFileUpload -> OnCompleted event -> AStream.FileName Quote Link to comment Share on other sites More sharing options...
Gustavo.deo Posted April 13, 2018 Author Share Posted April 13, 2018 Good morning friends!!!I should not have expressed myself well, I need to get the path of the source file (the file path of the end user's machine) ...Taking advantage of the opportunity, if I need to write the file on the server as permanent file (not as temporary file in the cache folder) ... anyone have any suggestions? Thanks!!! Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted April 13, 2018 Share Posted April 13, 2018 I need to get the path of the source file (the file path of the end user's machine) ... You use an uniFileUpload and want to get the path of the file on client machine? Then see #2. Quote Link to comment Share on other sites More sharing options...
Gustavo.deo Posted April 14, 2018 Author Share Posted April 14, 2018 You use an uniFileUpload and want to get the path of the file on client machine? Then see #2. Sorry my english but I use a translator !!! Okay clarified my doubt !!! But would you have some way to rename or delete this file from the client machine ??? And if I want to save this file from the fileupload to another folder other than temporary file, would it have to do ??? Thanks!!! Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted April 14, 2018 Share Posted April 14, 2018 Okay clarified my doubt !!! But would you have some way to rename or delete this file from the client machine ??? You get no access to client files. What if any website could delete your files? Why do you need that? Maybe there is another way. And if I want to save this file from the fileupload to another folder other than temporary file, would it have to do ??? procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream); var DestName : string; DestFolder : string; begin DestFolder := UniServerModule.StartPath + 'UploadFolder\'; DestName := DestFolder + ExtractFileName(UniFileUpload1.FileName); CopyFile(PChar(AStream.FileName), PChar(DestName), False); ShowMessage('File ' + UniFileUpload1.FileName + ' Uploaded to folder ' + DestFolder); end; Quote Link to comment Share on other sites More sharing options...
Gustavo.deo Posted April 14, 2018 Author Share Posted April 14, 2018 procedure TMainForm.UniFileUpload1Completed(Sender: TObject; AStream: TFileStream); var DestName : string; DestFolder : string; begin DestFolder := UniServerModule.StartPath + 'UploadFolder\'; DestName := DestFolder + ExtractFileName(UniFileUpload1.FileName); CopyFile(PChar(AStream.FileName), PChar(DestName), False); ShowMessage('File ' + UniFileUpload1.FileName + ' Uploaded to folder ' + DestFolder); end; Thanks!!!! You get no access to client files. What if any website could delete your files? Why do you need that? Maybe there is another way. the user will do the reading of a file, and I need to rename or even delete what is not to do the reading of the file again !!! To the know that this file has already been processed !!! Quote Link to comment Share on other sites More sharing options...
Oliver Morsch Posted April 14, 2018 Share Posted April 14, 2018 I think you have to check on server side if the file was uploaded before (is already in the upload folder). Or you must develop and install a client software. 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.