Enable private download method and set 'File system path' to 'files/' instead of 'files'.

Note that after submitting, it will still say 'files' because file_check_directory() removes the '/'. Don't resubmit or the variable will go back to 'files'.

file_create_url() will now return urls such as

http://192.168.0.1/sites/op_video/system/files/files/videos/image-cache/89_third_320x240.jpeg

instead of

http://192.168.0.1/sites/op_video/system/files/videos/image-cache/89_third_320x240.jpeg

The attached patch fixes this problem by stripping '/'s from the end of the path in file_directory_path() in the same way as file_check_directory() does.

CommentFileSizeAuthor
file_directory_path.patch636 bytesjbrown

Comments

drumm’s picture

Version: 5.x-dev » 7.x-dev
Status: Needs review » Needs work

I would like to see this written for the development version first, and then backported.

I think a better fix might be never storing a files directory path with a trailing slash. Probably by stripping the extra slash on saving the settings form.

codecowboy’s picture

Status: Needs work » Closed (fixed)

This should no longer be an issue with D7. This part of the code base has been completely rewritten.