I need to get the file attributes of a remote file using the ConnectionKit framework.
What I am trying to do is compare the modification date of the file on the server and if it is newer than the local copy then download it. I've got the CKTransferRecord for the transfer but this only gives me the remote file path not that remote files attributes.
What is the best way to get the remote files attributes?
Thanks for your help!
Related
I have setup flow force server in my local pc and I was able to run couple of sample jobs. Then I try to setup FTP store job by providing required details. I was also able to upload specific file in to FTP server as well.
But now I need to know whether there is a possibility to upload all the files in particular folder in to target folder in FTP server. Appreciate if someone who have knowledge above flowforce server can share their thoughts about this.
In this app, I am using FTP server to download and upload images to the server. Now, I want to check if file exist at server. I would have the file name to check on the server. Currently, I am using FTPManager class to do all uploading and downloading. Its working fine. But I couldn't find any solution to check if file exist at server
Please help me in this.
Assuming you're talking about this FTPManager class, it seems to me like you should be able to create a new FMServer instance with the path to the folder you want, then call the manager's -contentsOfServer: method to get an array of dictionaries containing file information at that path.
My basic requirement is to add a ".temp" suffix to a file while it is getting uploaded on to the FTP server (suffix should be only for time until the file is fully uploaded).
As per my understanding, i thought this could be achieved by: Add a suffix to file on the local machine, then upload it and after the upload is complete, rename the file to remove suffix on server.
But now the another problem is that i could not found a way to rename a file on FTP server using cocoa. I know renaming a file is feasible using Java or other languages but i want to achieve the same in objectiveC.
Please tell be if the above task is feasible and if it is what is the approach i should follow?
FYI: I know how to upload and download a file on FTP server using NSInputStream and NSOutputStream.
Thanks. I'd appreciate any help.
Take a look at CFNetwork FTP docs. They do not mention exactly your case, but there may be a way to sent RNFR and RNTO commands over the stream.
https://developer.apple.com/library/ios/#documentation/Networking/Conceptual/CFNetwork/CFFTPTasks/CFFTPTasks.html#//apple_ref/doc/uid/TP30001132-CH9-SW1
There is also a sample project you can look into:
https://developer.apple.com/library/ios/samplecode/SimpleFTPSample/Listings/Read_Me_About_SimpleFTPSample_txt.html
This library claims to do what you want (rename remote files)
http://www.chilkatsoft.com/ftp-objc.asp
I wanted to copy a file from one folder to another folder within a ftp server. For example if a file is on folder1 in a ftp server then i want copy it to folder2. I know how to move or rename the files in ftp server. I also searched in google to copy file within ftp server but i didn't get a work around for it.Also does rdp command line provides facilities like this? So anyone know how it can be done?
Now i am uploading the same file to two folders separately.So it does take more time.So if it is possible to copy the file then i need to upload only once and then copy it to other folder easily.
So anyone please come up with ideas or codes to do it.
Thank you
Regrettably, the answer is simple: there is no FTP copy command. For an exhaustive, well referenced list of FTP commands, see http://en.wikipedia.org/wiki/List_of_FTP_commands.
In the old days, when FTP was standard, you would have used its companion program telnet to operate in the remote directory.
I have successfully been able to upload single files to an FTP with this:
My.Computer.Network.UploadFile
Is there a way to upload an entire directory, such as this:
My.Computer.Network.UploadFolder
Never worked with FTP in VB.NET, but it seems there is no direct way to do it.
Here is what people say about how it can be done:
Traversal the local directory
Create the same directory structure in the FTP server.
Upload the file in each local directory.
Also see here for same question answered (C#). It confirms there is no built-in way. You would have to write some code or use 3rd party libraries.