I am very new in c++ and I need to implement an import interface which is going to connect to FTP, read the files from a specific directory and process the files...making some updates in the database and create log file on FTP. I succeeded to connect on FTP and create a directory there, by ftpClient->MKDir("test"), but I don;t know how I can open a directory read the files, opening the files and process the content of the files.
Could someone, please help me?
Thank you in advance!
C++Builder ships with Indy, which has a TIdFTP client component. Simply have it Connect() to the desired FTP server, ChangeDir() to the desired folder if needed, List() the current files if needed, Get() the desired file(s) to your local machine, process and modify them as needed, and then Put() them back into the remote folder.
Related
I want to use RoxyFileMan to manage uploaded images and files. But I should save them on the server. As you know, RoxyFileMan Upload uploads files and images in a folder named Uploads in a fileman directory. We can change FILES_ROOT to another local path to change the directory files get uploaded to.
But, I want to upload files on the server and then read them from the server after they've been uploaded so that they can be edited in ckeditor.
Can anyone please provide advice/guidance on how to achive this outcome?
It's not very clear how your question is meant, but if I understand you correctly, you are using RoxyFileMan on a local server and want to upload files to a remote online server, right?
Roxy uploads files to a directory on the server it is run from. Which means if run from localhost, it will use directory on your localhost. If run from a server, it will use a directory on server.
As far as my knowledge goes, you cannot upload from a localhost to an online server directly.
You could maybe achieve that using some custom script to open an FTP connection, but then you would have to also remake all the code to also load images from there... which would be rather silly.
I'm trying to upload a folder to a ftp server using Overbyte Ics Ftp component.
From what I understand there is no built in function to upload a folder containing files and sub-folders to a ftp so I have to create a recursion in order to upload them all into one call.
What is the correct approach to this problem?
I'm thinking about doing this:
scan the local folder that I want to upload and separate folders from files
for each folder name check if exists on the ftp. If not exists the create it
after creating all folders to the ftp server check if local file exists on the ftp. If not exists start uploading the file to the created directory.
Is this the proper way to do it?
Is there an easier approach to this task?
Thank you!
I want to upload a file on ftp and i am able to do so with help of apple sample Code https://developer.apple.com/library/ios/samplecode/SimpleFTPSample/Listings/Read_Me_About_SimpleFTPSample_txt.html#//apple_ref/doc/uid/DTS40009243-Read_Me_About_SimpleFTPSample_txt-DontLinkElementID_16
but the problem is while uploading the file if the directories not available on ftp server it should create it automatically.
For Example:
if my address is
192.168.1.100/fileTest/firstDirectory/secondDirectory/myfile.txt
My question is the code should check if fileTest/firstDirectory/secondDirectory/ this path exist or not. If not instead of giving me the stream error it should create the directories and upload my file.
Is this Possible. Any Ideas.. ? Any help will be appreciated.
Thank You in advance.
I am not sure if this is the right place to put this question
I want a good FTP Client which can upload the files to the server if any changes are made to a particular file in the directory its watching.
google 'windows ftp syncing' (I'm assuming windows) there's a pile of them.
hth
I have a D2007 application that uses Windows.CopyFile to copy MS Word and PowerPoint files from one network folder to another network folder. Our organization is migrating to Windows 7 from Vista. One of my migrated users got an error message that displayed a partial local folder (C:\Users\(username)\...\A100203.doc) during the copy. Does the CopyFile function cache a local copy of the document when it is copying from one network folder to another network folder or is it a direct write? I have never seen this error before and the application has been running for years on Win95, Win 98, Win2000, WinXP and Vista.
Windows.CopyFile does NOT cache the file on your hard drive... instead, it instructs Windows to handle the copying of the file itself (rather than you managing the streams in your own program). The output file buffer (destination) is opened, and the input buffer simply read and written. Essentially this means that the source file is spooled into system memory, then offloaded onto the destination... at no point is an additional cache file created (this would slow file copying down).
You need to provide more specific information about your error... such as either the text or an actual screenshot of the offending error message. This will allow people to provide more useful answers.
The user that launches the copy will require read access to the original and write access to the target, regardless of caching (if the user has read access to the file, then the file can be written to a local cache, so caching/no-caching is irrelevant).
It's basic security to disallow someone to be able to copy files/directories among machines just because the security attributes between the machines are compatible.
There's little else to say without the complete text of the error message.