Resolved XML and Virtual Directory

Molari51

Member
Joined
Jan 20, 2021
Messages
10
Programming Experience
3-5
I've spent the last few years slowly building my own record database to hold my vinyl collection, recently I extended it to include lyrics and album photos, I've always been looking for a freeware mp3 player to build into it, before Christmas I found Wimpy 7.81. Part of the structure for my website is as follows - have used _ (Underscores for indentation)

C#:
AlbumCovers (folder)
MusicFolder (folder - mp3 is stored here)
Wimpy_7.81 (folder)
_____frmMyPlayLists.aspx
__________frmMyPlayLists.aspx.cs
_____MyPlayList.xml

The MyPlayList.xml Code is as follows
XML:
<?xml version="1.0" encoding="utf-8" ?>
<playlist>
  <item>
    <file>../MusicFolder/04 Waterfront.mp3</file>
    <title>Waterfront</title>
    <artist>Simple Minds</artist>
    <image>path/to/image.jpg</image>
  </item>
</playlist>

Currently the webform loads, the track can be played from the wimpy player, however, it's not the appropriate place to be storing my MP3 within the root folder due to the size

Looking online I created a virtual directory in IIS called MusicCollection and the folder on my D Drive is called MusicTest, the structure in IIS now looks like
C#:
AlbumCovers (folder)
MusicFolder (folder - mp3 is stored here)
Wimpy_7.81 (folder)
_____frmMyPlayLists.aspx
__________frmMyPlayLists.aspx.cs
_____MyPlayList.xml
MusicCollection (virtual folder - this does not show in the solution explorer in visual studio)

The XML Code is as follows

XML:
<?xml version="1.0" encoding="utf-8" ?>
<playlist>
  <item>
    <file>MusicCollection/04 Waterfront.mp3</file>
    <title>Waterfront</title>
    <artist>Simple Minds</artist>
    <image>path/to/image.jpg</image>
  </item>
</playlist>

I have assigned permissions using IUSR and IIS_IUSRS, I have tried numerous ways to get the mp3 track to work from the virtual directory
XML:
<file>MusicCollection/04 Waterfront.mp3</file>
<file>../MusicCollection/04 Waterfront.mp3</file>
<file>04 Waterfront.mp3</file>

I'm unable to understand why, any help appreciated
 
Last edited by a moderator:
Solution
That is not what we asked you to try. We asked you just go to your browser and enter
C#:
"http://localhost/MyPersCollection/MusicCollection/04%20Waterfront.mp3"

Note the %20 above to replace the space character.
Morning
Firstly apologies, I didn't see the %20 on your original response, I tested to ensure that the URL was working, after adding your URL as above it all worked, can't believe and didn't even consider the %20. Many thanks for all your help

I'll be adding another field to my database now and will write some code to iterate all through the tracks to add the %20 wherever there is a space.

Much appreciated

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,029
Location
Chesapeake, VA
Programming Experience
10+
I don't use or know about Wimpy, but if I had to guess it actually uses file paths, not URLs.

That "MusicCollection" only exists as a URL that IIS can service. It's an IIS virtual directory. It's not an OS level virtual directory. From the point of view of Wimpy, it's going to need "D:\MusicTest\04 Waterfront.mp3".
 

Molari51

Member
Joined
Jan 20, 2021
Messages
10
Programming Experience
3-5
I don't use or know about Wimpy, but if I had to guess it actually uses file paths, not URLs.

That "MusicCollection" only exists as a URL that IIS can service. It's an IIS virtual directory. It's not an OS level virtual directory. From the point of view of Wimpy, it's going to need "D:\MusicTest\04 Waterfront.mp3".
Hi
Many thanks for coming back to me, unfortunately that didn't work
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,029
Location
Chesapeake, VA
Programming Experience
10+
What error are you getting?

Well according to the documentation, Wimpy actually uses URLs, not folder paths. So my suggestion above regarding using "D:\MusicText\04 Waterfront.mp3" is definitely going to fail:

Playlist releated issues​

- Check that the URLs to files actually exist.

Follow the recommendation they gave of using a path "from the root". e.g. "/MusicCollection/04 Waterfront.mp3"
 
Last edited:

Molari51

Member
Joined
Jan 20, 2021
Messages
10
Programming Experience
3-5
Have tried the methods above, there is no error message, the tracks just don't play, I'm getting the impression that Wimpy cannot handle Virtual Directories.
 

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,265
Location
Norway
Programming Experience
10+
The starting / is important, "/MusicCollection/04 Waterfront.mp3" means url "http: //yoursite/MusicCollection/04 Waterfront.mp3" and you should be able to test that virtual directory is set up correctly by using that url in browser to download the mp3 file directly. If you can then Wimpy can also play from that url.
 

Molari51

Member
Joined
Jan 20, 2021
Messages
10
Programming Experience
3-5
The starting / is important, "/MusicCollection/04 Waterfront.mp3" means url "http: //yoursite/MusicCollection/04 Waterfront.mp3" and you should be able to test that virtual directory is set up correctly by using that url in browser to download the mp3 file directly. If you can then Wimpy can also play from that url.
Hi John
I added an ASP button to the page and added a response.redirect to http://localhost/MyPersCollection/MusicCollection/iisstart.htm, the code launched the iisstart from the virtual directory which proves that the VD is working
I've tried various ways with the XML as above, still can't play any mp3 track
 

Skydiver

Staff member
Joined
Apr 6, 2019
Messages
4,029
Location
Chesapeake, VA
Programming Experience
10+
That is not what we asked you to try. We asked you just go to your browser and enter
C#:
"http://localhost/MyPersCollection/MusicCollection/04%20Waterfront.mp3"

Note the %20 above to replace the space character.
 

Molari51

Member
Joined
Jan 20, 2021
Messages
10
Programming Experience
3-5
That is not what we asked you to try. We asked you just go to your browser and enter
C#:
"http://localhost/MyPersCollection/MusicCollection/04%20Waterfront.mp3"

Note the %20 above to replace the space character.
Morning
Firstly apologies, I didn't see the %20 on your original response, I tested to ensure that the URL was working, after adding your URL as above it all worked, can't believe and didn't even consider the %20. Many thanks for all your help

I'll be adding another field to my database now and will write some code to iterate all through the tracks to add the %20 wherever there is a space.

Much appreciated
 
Solution

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
1,265
Location
Norway
Programming Experience
10+
Browser should handle that (and testing the url should show it), but that control probably don't. If you're generating these xml playlists I think you can use Uri.EscapeUriString method.
 
Top Bottom