So I want to download a bunch of mp3 files from this website, the website's URL structure is like this:
where the * is a number between 0 and 1000
Now, there is not 1000 songs, there could be songs that are from 100 to 200 but not 200 to 300. I discovered this site is using nginx and returns a proper 404 if a file does not exists, like this:
![[Image: B6IdOLu.png]](https://i.imgur.com/B6IdOLu.png)
![[Image: UF9hStX.png]](https://i.imgur.com/UF9hStX.png)
I have my code structured like this:
The thing is, I want my program to create a folder and then store the mp3 in it, so a new folder for each mp3 file but I want to check to see if the file actually exists before I go ahead and create the folder. How would I go on to do that?
Code
http://thiswebsite.com/music/*.mp3Now, there is not 1000 songs, there could be songs that are from 100 to 200 but not 200 to 300. I discovered this site is using nginx and returns a proper 404 if a file does not exists, like this:
![[Image: B6IdOLu.png]](https://i.imgur.com/B6IdOLu.png)
![[Image: UF9hStX.png]](https://i.imgur.com/UF9hStX.png)
I have my code structured like this:
Code
Private Sub DownloadMusicFile()
'Downloading Music
Dim MusicNumber As Integer = 0
Do Until MusicNumber = 1000
My.Computer.Network.DownloadFile("http://thiswebsite.com/music/" + MusicNumber + ".mp3",
My.Computer.FileSystem.CurrentDirectory + "/music/" + MusicNumber + "/")
Loop
End SubThe thing is, I want my program to create a folder and then store the mp3 in it, so a new folder for each mp3 file but I want to check to see if the file actually exists before I go ahead and create the folder. How would I go on to do that?




![[Image: Syr3DlV.png]](https://i.imgur.com/Syr3DlV.png)