Upload files to a sub-folder in App_Data\Files

Jan 22, 2008 at 2:08 PM
Hopefully this is an easy one. When you use the "Upload File" control under the admin page in the "Add Entry" tab to add a file to a blog post it places the file(s) under the ~"\App_Data\files" folder. The link to the files is:

<a rel="enclosure" href="/Cadd_Intranet/file.axd?file=2007.09.07-Annotative Text.wmv">

and everything works great!

HOWEVER, I would like to place those files in some sub-folders under that directory by manually moving the files on the IIS server and then re-pathing. When I do that I have troubles with the URL link above. For Word Doc files or PDFs I can simply modify the string to:

<a href="/Cadd_Intranet/file.axd?file=2008-Upgrade/Instructions.pdf">

adding the directory "2008-Upgrade" after the "files=" expression and everything works great. BUT I'm having trouble with WMV files. It doesn't seem to pass the extension to windows when you click on the link hence not starting the file to play in the Windows Media Player. Any suggestions are appreciated?

Feb 15, 2009 at 12:10 PM

I have the same problem - It finds the file but the extension isn't passed on so the Windows Media Player give me lots of strange errors, the most popular one "Your computer is running low on memory". If I right click the file and "save as"- I can play the file just fine.

Is this solved?

// Lazze
Feb 15, 2009 at 11:03 PM
Does the Window Media file play correctly if you access the WMV directly without going through file.axd?

Feb 16, 2009 at 2:50 AM
I tested this out on my blog.

If I left click on the file.axd link in Firefox, the dialog window opens up where I can either 'Open with Windows Media Player' or 'Save File'.  If I select 'Open with...', Windows Media Player launches and starts playing the WMV.  The 'Save File' option just saves the WMV to disk.  So, both options work in Firefox.

If I left click on the file.axd link in IE7, Windows Media Player launches and starts playing the WMV.

So, I'm basically not having any problems when I test this.  If you're getting strange errors and low memory errors, I'm fairly confident that's not a problem with BE or file.axd.
Feb 16, 2009 at 7:49 AM

That "low memory" error you are seeing is from BE sending a "faulty" streamheader to Windows media player. See my post "bug? Bad design"

// Lazze
Feb 16, 2009 at 4:34 PM
Lazze, I replied in the "bug? Bad design" thread.