file management

Topics: Controls
Jul 20, 2009 at 10:51 PM

Is there an admin tool for managing files? (I.E. delete, replace, upload)?

Where are files stored when accessed via File.asxd?

Coordinator
Jul 21, 2009 at 6:11 AM

There isn't an admin tool.  You could use FTP to delete old images/files, for example.

The images/files you upload are put into the App_Data\files directory.  This is where file.axd and image.axd look for files and images.

Jul 21, 2009 at 6:56 AM

There is nothing in App_Data, nor is there a files directory.

Could the app be configured to store the files elsewhere? If so, what file would contain that configuration?

Coordinator
Jul 21, 2009 at 7:43 AM

In the web.config file, there's an <appSetting> named "StorageLocation".  By default the value for this setting is "~/App_Data/".  All files will be stored in this folder.

The images and files you upload for blog posts will specifically be in a sub-folder named "files".  So if you're using the default StorageLocation of App_Data, images and files served by file.axd and image.axd will come from the App_Data\files folder.

Jul 21, 2009 at 3:37 PM

StorageLocation is set to ~/App_Data/.Yet, the directory is empty.

Is there any other setting that overrides StorageLocation?

Could the files be stored in a database somehow?

Coordinator
Jul 22, 2009 at 8:18 AM

Images and files aren't stored in the DB.

Are these images or files that you uploaded when creating a blog post?  What is the URL to these images/files?  What version of BE are you using?  Has your BE installation been customized?

Jul 22, 2009 at 2:41 PM

I believe the files were uploaded with a blog post.

sample file - http://blog.brian-blanchard.com/file.axd?file=2009%2f1%2fRES-Brian+Blanchard.doc

BE version 1.4.5.0

The theme was customized. However, I do not beleive the BE Sourcecode was customized

Coordinator
Jul 22, 2009 at 11:58 PM

The URL to that sample file looks like a typical URL that BE uses for uploaded files.

When uploading a file/image, BE actually puts it into sub-folders in the App_Data\files folder.  The first sub-folder name is the year of when the file/image was added.  Within that sub-folder, there's another sub-folder representing the month in which the file is added.  So in this case, that DOC file should be in:

App_Data
    files
        2009
            1
                - the DOC file

Jan 26, 2010 at 6:30 PM
Edited Jan 26, 2010 at 6:31 PM

Sorry to resurrect this, but my question is semi-related.

Is there an easy way to change how it stores the file, or how it links to them? I don't mind the fact that it stores the files in a subdirectory based on date, but what I find annoying is that it appends this to the beginning of the file when someone goes to download it.

For example, if I upload the file filename.ext while creating a post, it would put it at App_Data/files/2010/1/filename.ext. This is fine, but the link it autocreates using file.axd?file= makes it so when someone downloads the file it is named 2010_1_filename.ext. For now I get around this by logging into my server, manually moving the file back to the App_Data/files directory, and then manually going in and changing the link in the post.

So, is there a way to change it so it doesn't append the folder names on download, or if that is not possible just dump stuff in the files directory directly? It would make files easier to post when I don't have easy access to my server to move files around.