FlavioMacedo Posted March 24, 2017 Share Posted March 24, 2017 Good morning everyone. The problem is this: I installed the application where I have to present the directory tree of the client machine and I'm putting this in a treeview but it always mounts the directory tree where the application is running. I need this tree to be the one of the client machine and not of the server. Could someone help me with this problem? My code that mounts the memory table to show the directory looks like this: procedure TMainForm.DirTreeChange(Sender: TObject; Node: TUniTreeNode); var sr: TSearchRec; FileAttrs: Integer; theNode: TUniTreeNode; begin FileAttrs := faDirectory; if (Node.Level = 0) then exit; if (Node.Level = 1) then begin Ni1 := 'c:\' + Node.text; end; if (Node.Level = 2) then begin Ni1 := 'C:\' + Node.Parent.text + '\' + Node.text; end; if (Node.Level = 3) then begin Ni1 := 'C:\' + Node.Parent.Parent.text + '\' + Node.Parent.text + '\' + Node.text; end; ... ... ... if (Node.Level = 12) then begin Ni1 := 'C:\' + Node.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.Parent.text + '\' + Node.Parent.Parent.text + '\' + Node.Parent.text + '\' + Node.text; end; MemData_Diretorio.Close; MemData_Diretorio.Open; if FindFirst(Ni1 + '\*.*', FileAttrs, sr) = 0 then begin repeat if (sr.Attr and FileAttrs) = sr.Attr then begin if ((sr.name <> '.') and (sr.name <> '..')) then begin if Node.Level = 0 then begin theNode := DirTree.Items.AddChild(nil, sr.name); end else begin theNode := DirTree.Items.AddChild(Node, sr.name); end; theNode.HasChildren := True; end; end else begin MemData_Diretorio.Insert; MemData_Diretorioupdate.AsBoolean := false; MemData_DiretorioArquivo.asstring := sr.name; MemData_DiretorioModificacao.asstring := FormatDateTime('dd/mm/yy hh:mm:ss', FileDateToDateTime(sr.Time)); MemData_DiretorioTamanho.asstring := inttostr(sr.Size); MemData_Diretorio.Post; end; until FindNext(sr) <> 0; FindClose(sr); end; end; Thank you all for the help. Thank you Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 24, 2017 Share Posted March 24, 2017 Hi, if I understand your correctly... you're hoping to read a directory on the client's machine from your server. If so you can't do this - it would be a major security violation. Best regards Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 24, 2017 Author Share Posted March 24, 2017 I'll try to explain it better. I am making an application for managing files where the user has a treeview with the directory of his workstation and another one with the directories of the server. The server is OK but the local machine where the user could get their files, drag and drop into the server directory. In the location where the directory of the client machine should appear the server always appears. I am not able to direct the program to pick up the user's machine pastes so that it selects the file to upload. It's more or less like a dropbox. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 24, 2017 Share Posted March 24, 2017 You can not create client files lists on the tree,You can only select files, for example using UniFileUpload Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted March 24, 2017 Administrators Share Posted March 24, 2017 For security reason a browser can't access local file system. Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 Thanks for the answers but some more questions. 1) there is then some way of being able to select multiple files at a time to upload them all together. I'm trying to use it with unifileupload because I can only select 1 file at a time and would have to upload an entire directory. 2) How do I keep track of the upload progress of the files? Thank you all for your help. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 29, 2017 Share Posted March 29, 2017 Hi, For now you can try to use the following solution, look at this post: http://forums.unigui.com/index.php?/topic/2490-multiple-file-upload/ http://forums.unigui.com/index.php?/topic/2490-multiple-file-upload/page-2&do=findComment&comment=38734 Best regards. Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 I have already taken this example but at the time of compilation I get this error: Fatal Error] ulsGlobal.pas (535): F2613 Unit 'Windows' not found. Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 Eu já tomei este exemplo, mas no momento da compilação recebo este erro: Fatal Error] ulsGlobal.pas (535): F2613 Unidade 'Windows' não encontrado. Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 Hi, For now you can try to use the following solution, look at this post: http://forums.unigui.com/index.php?/topic/2490-multiple-file-upload/ http://forums.unigui.com/index.php?/topic/2490-multiple-file-upload/page-2&do=findComment&comment=38734 Best regards. I have already taken this example but at the time of compilation I get this error: Fatal Error] ulsGlobal.pas (535): F2613 Unit 'Windows' not found. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 29, 2017 Share Posted March 29, 2017 Try with the latest build,Are you using a trial edition?! Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 Try with the latest build, Are you using a trial edition?! Yes. I'm using the trial version. Once the project is operational I will be buying the full version. I have the latest version of the site. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 29, 2017 Share Posted March 29, 2017 Please check Tools->Library->paths it seems paths are wrong Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 Please check Tools->Library->paths it seems paths are wrong The path must be correct because the entire project is unigui including the examples are working correctly. It must be something else. The .pas file that is giving the error as I understand it is an Indy file. My indy is version 10 using with Delphi 10.1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 29, 2017 Share Posted March 29, 2017 Sorry, did you try with this example, please check again?!: http://forums.unigui.com/index.php?app=core&module=attach§ion=attach&attach_id=3694 Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted March 29, 2017 Author Share Posted March 29, 2017 Sorry, did you try with this example, please check again?!: http://forums.unigui.com/index.php?app=core&module=attach§ion=attach&attach_id=3694 OK. This one is compiling perfect. I'll try. Thank you Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted April 10, 2017 Author Share Posted April 10, 2017 The above example works perfect for dragging files from the user's desktop to the application server. Is there an example of the function doing the opposite way, or is it dragging from the application server to the user's machine? Thank you all for your help. Quote Link to comment Share on other sites More sharing options...
ZigZig Posted April 10, 2017 Share Posted April 10, 2017 Could you please give us an example of a website that does what you're asking (no matter what technology it is based on)? Quote Link to comment Share on other sites More sharing options...
FlavioMacedo Posted April 10, 2017 Author Share Posted April 10, 2017 Good afternoon friends. I do not know any website that does this but would only drag the file from the site to the local machine to start downloading. This would be the need. Make something very easy for the user as if he were on his own windows (local environment) Quote Link to comment Share on other sites More sharing options...
Ron Posted April 15, 2017 Share Posted April 15, 2017 Maybe you can let the user drag files to a listbox, and when ready to download you can then zip them all and send that single file, or trigger download of all files in a row. 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.