Solved

Uploading with Indy

Posted on 2012-04-02
2
553 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…

785 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