I want to upload images to server through ftp.
I found a SimpleFTPSample in apple documentation, and downloaded it.
When running the app(I'm using xcode 4.5.2, target iphone 5.0 simulator) it works fine. I'm trying to create directory in my server through this app and succeeded.
But, when uploading the image provided in the app will result in "open stream error". I didn't do any change in the app. Just typed the url,username and password. I think there is no issue with this, since, the directory which I specified was created succesfully.
While creating directory the url is "ftp://54.x.y.z/newfolder/" it is created successfully.
But, while uploading the url is "ftp://54.x.y.z/TestImage1.png"
the filepath is "/var/folders/pn/8p0jc4qn70v37j58c1kwf8l80000gn/T/TestImage1.png"
url is got by appending the last component string with the ftp url which I specified.
So, what is the mistake in it?
In the fn,
- (void)stream:(NSStream *)aStream handleEvent:(NSStreamEvent)eventCode
{
case NSStreamEventErrorOccurred: {
[self stopSendWithStatus:@"Stream open error"];
} break;
was called and displayed Stream open error.
I googled a whole day and no needed results. Its very urgent and I even can't start a bounty for this. Please help
Try this....
I have same issue.
This is per the hosting provider. I think the problem is that the code maybe getting confused by the "@" sign in the login name = dev@atoz.com.?
Are you using user name with @ sing ?
Adding this line before setting the networkStream delegate in PutController.m StartSend fixed the problem for me:
Without the above line (or with the property set to kCFBooleanTrue instead of kCFBooleanFalse), I consistently got Stream Open Error. I only tried with one FTP server, but it doesn't seem to support passive mode which is apparently the default.