Jump to content

problem with file download


sean1688

Recommended Posts

I tried to create a public folder using the downloads tab in admin, and uploaded a image file to the folder. for whatever reason the file is not accessible. however, with another website of ours, this same exact operation was successful. What might be the difference between the two websites to cause the different behavior?

Link to comment
Share on other sites

The folder that many recent versions of CubeCart uses for storing files able to be downloaded is /files/. Within that folder is an .htaccess file that denies access to everyone to all files except files that begin with print and files that begin with hash.

However, within /files/ is a folder named /public/, and within that folder is an .htaccess file that allows access to everyone to all files.

So, if you created another publically accessible folder other than /files/public/, be sure that there is a .htaccess file that says:

allow from all

You say "another website of ours". Be aware that not all webservers understand .htaccess files. Therefore, if the two sites are in server environments that have different webservers, be sure the one that does not work understands .htaccess files, or get the webserver configured accordingly (e.g., nginx).

Please note that these .htaccess files are instructions for the webserver. Files to be downloaded under CubeCart's control, as when a downloadable file is a purchased digital product, there shouldn't be any problems.

Link to comment
Share on other sites

I have now run into another issue. Once I upload the files into the folders, each individual files can be viewed with the detailed path information, however, when trying to view the files in the folders, the files list is not viewable, instead, it shows a blank. How can we make the files list with names viewable?

Link to comment
Share on other sites

I assume from your description, you FTP'd the files directly into /files/whatever/, as opposed to uploading them through CubeCart's admin, Downloads, Upload tab.

And by "viewing the files in the folders", I assume you mean that the files are not showing in the admin, Products, (Edit a Product), Digital tab. They might not even show in admin, Downloads, Files tab.

That is because, for proper management of images and files, CubeCart maintains a CubeCart_filemanager database table. If CubeCart did not log a file in the FileManager's database table, it may not show up anywhere in CubeCart.

However, that can be rectified. In admin, Downloads (aka Download Filemanager), there is an Update File List tab, that when clicked, will scan through all the folders in /files/ and get all the files found, starting at /files/, loaded into the CubeCart_filemanager database table.

 

Link to comment
Share on other sites

Thanks for your help. Sorry I did not make it clear in the previous posting.

I uploaded the files via admin into files/public/images/, the files are visible in the admin. however, when viewing from the domain/files/public/images/, the files are not visible. similarly, if you trying to view the files folders under domain/files/public/, the images folder is not visible. however a particular file is visible, as in domain/files/public/images/pic1.jpeg.

Thanks in advance

Link to comment
Share on other sites

Ok, so everything looks like CubeCart is behaving properly?

But giving the browser either of these web addresses:

www.example.com/files/public/
www.example.com/files/public/images/

gets you a blank screen?

That is probably because the webserver is configured to not allow the viewing of directory contents -- specifically named files, yes -- but not a listing of everything in the folder.

There is this statement in CubeCart's main folder's .htaccess file:

### Apache directory listing rules ###
DirectoryIndex index.php index.htm index.html
IndexIgnore *

The IndexIgnore has a pattern (the *) that means anything and everything is to be ignored (not shown) when the browser asks for a showing of the contents of that folder.

There is another common directive found in the actual webserver configuration file that tells the webserver to deny requests to list the contents of a directory (that is, Options -Indexes). This directive returns a 403 Denied response code.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...