Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 02-23-2009, 01:41 AM   #1 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 1
Unhappy s

I have used NSURLConnection to download a single file successfully but now I don't know how to download all files in a directory in a server.
Example: if the url is: http://www.example.com/directory/ => download all files in this directory. If the url is http://www.example.com/directory/ex.jpg => just download this file. Please help me. Thanks in advance.

Last edited by heolun4mat; 02-23-2009 at 04:20 AM.
heolun4mat is offline   Reply With Quote
Old 02-23-2009, 11:01 AM   #2 (permalink)
New Member
 
Join Date: Sep 2008
Posts: 1,431
Default

There is no standard way to get a file listing of an arbitrary file server. I know that Apache will give a listing of the files in a directory but it's in an html format which your code would need to parse and which might differ for different versions of Apache.

Not sure how you work around this.
PhoneyDeveloper is offline   Reply With Quote
Old 02-23-2009, 11:17 AM   #3 (permalink)
Don
Registered Member
 
Join Date: Jan 2009
Posts: 67
Default

Quite often web servers are configured explicitly to NOT allow directory listings - in fact, that's the default on IIS.

The only approach that would be reliable would be to put a script on your server that returns a list of files in the directory. Have your app call that script, stuff the results in an array, and then loop through retrieving one file at a time.

- Don
Don is offline   Reply With Quote
Old 03-19-2010, 08:27 AM   #4 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 1
Default

Quote:
Originally Posted by Don View Post
Quite often web servers are configured explicitly to NOT allow directory listings - in fact, that's the default on IIS.

The only approach that would be reliable would be to put a script on your server that returns a list of files in the directory. Have your app call that script, stuff the results in an array, and then loop through retrieving one file at a time.

- Don
Hi,

I have the same exact issue. I need to download all the files in a folder. The folder contains a csv with the names of all the files in the server.

So if I have the name of all the files in the folder, (around 200-300 images), what would be the best approach to download them all?
roeik is offline   Reply With Quote
Old 04-13-2010, 11:38 AM   #5 (permalink)
Registered Member
 
Join Date: Sep 2009
Posts: 162
Default

Quote:
Originally Posted by roeik View Post
Hi,

I have the same exact issue. I need to download all the files in a folder. The folder contains a csv with the names of all the files in the server.

So if I have the name of all the files in the folder, (around 200-300 images), what would be the best approach to download them all?
You will need to read the contents of the CSV in a array for example and process each file at a time.


There are numerous examples on how to read a file on the forum.

-open url connection
- read file contents into an array for example
- loop thru array and process each file
__________________
Iphone Developers Exchange --> iPhone Dev Exchange
Iphone Dev Tweets --> iPhone Developers Tweets
web20devxer is offline   Reply With Quote
Reply

Bookmarks

Tags
download, web

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 270
17 members and 253 guests
ADY, Alsahir, Dani77, Desert Diva, Duncan C, F_Bryant, Grinarn, HemiMG, Herbie, jansan, linkmx, M@realobjects, macquitzon216, prchn4christ, smethorst, spiderguy84
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,882
Threads: 89,228
Posts: 380,761
Top Poster: BrianSlick (7,129)
Welcome to our newest member, jansan
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 01:44 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0