Solved

Uploading with Indy

Posted on 2012-04-02
2
555 Views
Last Modified: 2012-04-07
Using the Indy component, user logs on and creates directories on the server. These directories are named in a listbox.

I have a stringgrid:
Row 0: File Name.
Row 1: Path of this file on the user's computer.
Row 2: Path to the location where this file is to be uploaded.
Row 3: Transfer Mode (ASCII or Binary).
Row 4: Chmod value of this file.

Files are uploaded and chmoded according to the stringgrid.

I am using Delphi XE.  Your help is greatly appreciated.
0
Comment
Question by:rincewind666
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Thommy earned 500 total points
ID: 37798377
For your Indy FTP UpLoad you can use following unit, where upload is done in a thread:
FTP-Upload mit Indy als Thread

You can upload several files at a time by adding files to the upload list (procedure AddToFileList).
All files must be located in the same directory, which must be set by "SetSourceDir".
FTP configuration is loaded by "LoadConfig" out of an ini file. Adapt this procedure to load the configuration from your stringgrid.
Most of the time the thread is sleepinp. You wake it up with "StartUpload" and the transfer starts.
After a successful transfer the file list is deleted, status is set to ftpReady and the thread falls asleep again.
If the thread is sleeping and status is not ftpReady, then status shows the ftp action, which causes an error.
While uploading, "StartUpload" is blocked.

See below how you can add setting of chmod file permission to the above unit...
chmod (Setting File Permissions)
0
 

Author Closing Comment

by:rincewind666
ID: 37818565
Many thanks for your help.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question