Jenny Eastman <[EMAIL PROTECTED]> writes: > Im writing a perl auto-downloader that is supposed to maintain the > directory structure. My problem is that with a link like > http://www.cisco.com/abcd extracted from a file i have no know no > way of knowing whether what i am downloading is a file or > directory(because when you try to d/l a dir the server sends the > default page). As a result i dont know whther to store m the file > the server sent with abcd or as xyz.html. > > Is it true that when you request a dir www.cisco.com/abcd the server > sends a redirect to www.cisco.com/abcd/ .How are you handling this > problem.
Wget handles this by changing the file name to abcd/index.html if/when the server sends the redirect. Therefore the file "abcd" will be saved as "abcd", while a directory "abcd" will be saved as "abcd/index.html".
