Drop File and Moving Files lazarus / 16-Databases ---------------------------------------------------------------------- StaticStupid · 2010-11-08 16:33 Hi, i have a question: Is it possible to take the dropped file in my form and move/copy it to some directory? (ex. I will drop some image file, and i want the same image to be copied or moved to X directory.) -If i can ask for example too. ---------------------------------------------------------------------- typo · 2010-11-08 16:40 Yes, you can set AllowDropfiles form's property to true and write code on the event OnDropFiles to do whatever you want. ---------------------------------------------------------------------- StaticStupid · 2010-11-08 16:55 I am fine with AllowDropFiles, now can u write me a simple code, how to accept the dropped Files, and relocate in some folder, move or copy, don't mind me which one? ---------------------------------------------------------------------- typo · 2010-11-08 17:04 My Help System is down and I could not help you to find the specifoc stuff to move files, sorry. Code: [Select]function CopyFile(   const SrcFilename: String;   const DestFilename: String ):Boolean; function CopyFile(   const SrcFilename: String;   const DestFilename: String;   PreserveTime: Boolean ):Boolean ---------------------------------------------------------------------- StaticStupid · 2010-11-08 17:22 When you can or when your Help System is Up, write me new code and explain it a little bit, coz i am newbie, meanwhile i will try to understand this thing. ---------------------------------------------------------------------- typo · 2010-11-08 17:34 Code: [Select]procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of String   ); begin   if CopyFile(FileNames[0],  DestFilename) then     ShowMessage(FileNames[0] + ' copied'); end; Why every newbie want to handle files? ---------------------------------------------------------------------- StaticStupid · 2010-11-08 18:16 Well i have some ideas which will help to access to file and folder much easier than manual windows allow me, so it does require file handling, maybe that's why + its good for upgrading my knowledge! ^^ Awesome dude, THANK YOU! ---------------------------------------------------------------------- ivan17 · 2010-11-08 21:21 Quote from: typo on November 08, 2010, 06:34:49 pmWhy every newbie want to handle files? because it something you can feel, noone likes abstract exercises. ---------------------------------------------------------------------- StaticStupid · 2010-11-09 23:15 Question: How to copy the file with his own name and his own file type, and how to copy multiply files? I was searching, nothing found, so just to know i am giving effort i am not sitting with crossed arms. ---------------------------------------------------------------------- Leledumbo · 2010-11-10 01:17 QuoteHow to copy the file with his own name and his own file typeAsk with InputBox or self created dialog, CopyFile's 2nd argument doesn't have to have the same name. About file type, I think you're talking about file extension. It's just a concept to ease the OS (not always) and user to identify the content. The content itself could be totally different. Quotehow to copy multiply files?Use loop