Zen Cart Logo
Forums / Setting Up Categories, Products, Attributes / Download error no matter what. (File not found)

Download error no matter what. (File not found)

Locked

Views: 3,186

Results 1 to 20 of 21
This thread is locked. New replies are disabled.
9 Dec 2008, 3:38 PM
#1
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Download error no matter what. (File not found)

Hello all!

My Zencart store isn't fully cooperating..

When shopping a downloadable product, it doesn't find the file that is meant to ble downloaded. This has nothing to do with the configuration on Admin side, admin find the file and in this case we're using the test.zip file that comes with Zencart.

It doesn't matter what filetype og name it has, and I've tried with all kind of settings in Configure>attributes.

I told my host about this and they said it is something wrong the the configure file. What file they meant I don't know. I think it has something to do with the includes>configure.php

Here is includes>configure.php:

// Define the webserver and path parameters
  // HTTP_SERVER is your Main webserver: eg, http://www.yourdomain.com
  // HTTPS_SERVER is your Secure webserver: eg, https://www.yourdomain.com
  define('HTTP_SERVER', 'http://solvenus.no');
  define('HTTPS_SERVER', 'https://solvenus.no');

  // Use secure webserver for checkout procedure?
  define('ENABLE_SSL', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_CATALOG', '/nettbutikk/');
  define('DIR_WS_HTTPS_CATALOG', '/nettbutikk/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_DOWNLOAD_PUBLIC', DIR_WS_CATALOG . 'pub/');
  define('DIR_WS_TEMPLATES', DIR_WS_INCLUDES . 'templates/');

  define('DIR_WS_PHPBB', '/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_CATALOG', '/home/solvenu/public_html/nettbutikk/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
  define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'xxx');
  define('DB_SERVER_PASSWORD', 'xxx');
  define('DB_DATABASE', 'xxx');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'database'); 
  define('DIR_FS_SQL_CACHE', '/home/solvenu/public_html/nettbutikk/cache');

This is admin>includes>configure.php:

 define('HTTP_SERVER', 'http://solvenus.no');
  define('HTTPS_SERVER', 'https://solvenus.no');
  define('HTTP_CATALOG_SERVER', 'http://solvenus.no');
  define('HTTPS_CATALOG_SERVER', 'https://solvenus.no');

  // Use secure webserver for catalog module and/or admin areas?
  define('ENABLE_SSL_CATALOG', 'false');
  define('ENABLE_SSL_ADMIN', 'false');

// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!
// * DIR_WS_* = Webserver directories (virtual/URL)
  // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder)
  define('DIR_WS_ADMIN', '/nettbutikk/admin/');
  define('DIR_WS_CATALOG', '/nettbutikk/');
  define('DIR_WS_HTTPS_ADMIN', '/nettbutikk/admin/');
  define('DIR_WS_HTTPS_CATALOG', '/nettbutikk/');

  define('DIR_WS_IMAGES', 'images/');
  define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/');
  define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/');
  define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/');
  define('DIR_WS_INCLUDES', 'includes/');
  define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/');
  define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/');
  define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/');
  define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/');
  define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/');
  define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_ADMIN', '/home/solvenu/public_html/nettbutikk/admin/');
  define('DIR_FS_CATALOG', '/home/solvenu/public_html/nettbutikk/');

  define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/');
  define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/');
  define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/');
  define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/');
  define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/');
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');

// define our database connection
  define('DB_TYPE', 'mysql');
  define('DB_PREFIX', 'zen_');
  define('DB_SERVER', 'localhost');
  define('DB_SERVER_USERNAME', 'xxx');
  define('DB_SERVER_PASSWORD', 'xxxx');
  define('DB_DATABASE', 'xxx');
  define('USE_PCONNECT', 'false'); // use persistent connections?
  define('STORE_SESSIONS', 'db'); // use 'db' for best support, or '' for file-based storage

  // The next 2 "defines" are for SQL cache support.
  // For SQL_CACHE_METHOD, you can select from:  none, database, or file
  // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache 
  // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder
  // ie: /path/to/your/webspace/public_html/zen/cache   -- leave no trailing slash  
  define('SQL_CACHE_METHOD', 'database'); 
  define('DIR_FS_SQL_CACHE', '/home/solvenu/public_html/nettbutikk/cache');

Heres a link to the english side of our online store:
http://solvenus.no/nettbutikk/index.php?main_page=index&language=en

If you want to help us and need to test our store, go to "MENU_PRODUKT" (yes, I need to change that one) in the menu and buy the product "test". Try to download it..

I won't cost you anything :laugh:

Thank you
Svein Daniel Solvenus

9 Dec 2008, 3:41 PM
#2
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Attribute Settings is set to:
Enable Downloads true
Download by Redirect true
Download by streaming false

9 Dec 2008, 4:35 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Download error no matter what. (File not found)

solvenus:

This has nothing to do with the configuration on Admin side, admin find the file and in this case we're using the test.zip file that comes with Zencart.

If the admin shows a green dot next to the file in the Downloads Manager, then it means it can find the file, and thus a "Download by redirect = FALSE" should work fine. However, you have password-protected your /download/ folder, which blocks the Redirect=FALSE from working.

solvenus:

Attribute Settings is set to:
Enable Downloads true
Download by Redirect true
Download by streaming false
Since you've got Redirect=TRUE set, then the files are served from your /pub/ folder. This means your /pub/ folder needs to have (a) read+write permissions set on it, and (b) symlinks need to be allowed. Your store will need to create a symlink inside the /pub/ folder in order to set up the redirect each time someone clicks the download link for the requested file.

10 Dec 2008, 8:35 AM
#4
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Thank you DrByte for answering!

I removed the password protection from the download folder and removed sett Redirect to FALSE. And admin is showing a green dot next to the file in Download Manager.

The same problem again.

The pub folder have read write access. 777.

How do I allow symlinks?

I truly don't understand what is wrong. The same error happens everytime, what ever configuration I use. The error has to be something fundamental.

When I use redirect = true, can the download folder be password protected?

Thank you
Svein Daniel Solvenus

PS. I've left the password protection off (Redirect=FALSE). So if someone want to try again, I am happy to let that someone be my guest =)

11 Dec 2008, 4:33 AM
#5
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Download error no matter what. (File not found)

Unzip the attached symlinktest script and upload the .php file to your server, in the store root ... ie: the same folder as your /pub/ folder can be found.

Then open it via your browser by typing your store URL and instead of adding index.php, use symlinktest.php

What happens?

11 Dec 2008, 10:18 AM
#6
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

SYMLINK TEST RESULTS:
DIR_FS_DOWNLOAD = /home/solvenu/www/nettbutikk/download/
Selected Filename = test.zip
Filename for Browser = test.zip
Symlink Filename = /home/solvenu/www/nettbutikk/pub/.tgCMJjCyoutWnNeY/test.zip

Symlink Message = ERROR - could not create symlink
Symlink Exists? = NO
Download test link: test.zip

This is what I got.
Do you know what I do about this?

I've put Download by Rerdirect = TRUE
Pub and download folder is set to 777

11 Dec 2008, 10:27 AM
#7
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

I searched my files after the word symlink and this came up:

/home/solvenu/public_html/nettbutikk/includes/modules/pages/download/header_php.php

Line #133 : $link_create_status = @symlink(DIR_FS_DOWNLOAD . $origin_filename, DIR_FS_DOWNLOAD_PUBLIC . $tempdir . '/' . $download_link);

Line #136 : $zco_notifier->notify('NOTIFY_DOWNLOAD_VIA_SYMLINK___BEGINS');

I don't know if this is relevant..

11 Dec 2008, 10:58 AM
#8
paupau avatar

paupau

New Zenner

Join Date:
Nov 2008
Posts:
9
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Hi
I have the same problems and tried the test.
It creates the symlink but don't find it!

Symlink Message = No error when creating symlink
Symlink Exists? = NO

...and then I get the same error page when trying the download link.
What to do?

11 Dec 2008, 5:38 PM
#9
paupau avatar

paupau

New Zenner

Join Date:
Nov 2008
Posts:
9
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Hi
I just solved my problem with download by redirect, by spelling out the full "COMPLETE path" for the download library as it tells 2 lines above the "define('DIR_FS_DOWNLOAD' " line. In your case it should be:

// * DIR_FS_* = Filesystem directories (local/physical)
//the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
define('DIR_FS_CATALOG', '/home/solvenu/public_html/nettbutikk/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . '/var/www/vhost/accountname/public_html/store/download/');
define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

Used the same path in bouth configure.php files .

Cheers from Dalarna in Sweden

12 Dec 2008, 10:01 AM
#10
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Tack söta bror =)

Then it seems we're one step closer to a solution:

Warning: filesize() [function.filesize]: stat failed for /home/solvenu/public_html/nettbutikk//home/solvenu/public_html/nettbutikk/download/ in /home/solvenu/public_html/nettbutikk/symlinktest.php on line 24

SYMLINK TEST RESULTS:
DIR_FS_DOWNLOAD = /home/solvenu/public_html/nettbutikk//home/solvenu/public_html/nettbutikk/download/
Selected Filename =
Filename for Browser =
Symlink Filename = /home/solvenu/public_html/nettbutikk/pub/.wnUFviwJSqDnwViXXFWI/

Symlink Message = ERROR - could not create symlink
Symlink Exists? = YES
Download test link:

Now the link is missing...

And there is a red errormessage in the store: http://solvenus.no/nettbutikk/index.php?main_page=index&language=en

This is the configure.php (I made the change in both files)

// * DIR_FS_* = Filesystem directories (local/physical)
  //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/
  define('DIR_FS_CATALOG', '/home/solvenu/public_html/nettbutikk/');

  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . '/home/solvenu/public_html/nettbutikk/download/');
  define('DIR_FS_DOWNLOAD_PUBLIC', DIR_FS_CATALOG . 'pub/');
  define('DIR_WS_UPLOADS', DIR_WS_IMAGES . 'uploads/');
  define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);
  define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/');

Anyone?

12 Dec 2008, 1:46 PM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Download error no matter what. (File not found)

solvenus:

define('DIR_FS_CATALOG', '/home/solvenu/public_html/nettbutikk/');

define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . '/home/solvenu/public_html/nettbutikk/download/');


Since 'DIR_FS_CATALOG' is (appropriately) defined to '/home/solvenu/public_html/nettbutikk/', you don't need to *also* include that part if DIR_FS_CATALOG is already specified as part of DIR_FS_DOWNLOAD:
That's why you have the duplication:
  define('DIR_FS_DOWNLOAD', **DIR_FS_CATALOG** . '**/home/solvenu/public_html/nettbutikk**/download/');

The normal definition for DIR_FS_DOWNLOAD is:```
  define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . '/download/');
12 Dec 2008, 3:46 PM
#12
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Yes, I understand. I've changed it back. To were it was before, when it didn't work.. If the problem is not in the configure file, where can it be then? What is the potential faults here?

14 Dec 2008, 9:00 PM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Download error no matter what. (File not found)

If you've changed it back, what happens if you run the tool again?

14 Dec 2008, 9:13 PM
#14
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

This:

SYMLINK TEST RESULTS:
DIR_FS_DOWNLOAD = /home/solvenu/public_html/nettbutikk/download/
Selected Filename = test2.zip
Filename for Browser = test2.zip
Symlink Filename = /home/solvenu/public_html/nettbutikk/pub/.HFqerhRyFpArTiJuSFI/test2.zip

Symlink Message = ERROR - could not create symlink
Symlink Exists? = NO
Download test link: test2.zip

I've installed a temp store in www.solvenus.no/TEMPBUTIKK.
Downloads work in this one.... So.. Right now I am comparing every file with WinMerge and I'm going to go through the configuration on ADMIN side so see if any fault is detectable.

The only difference in the configure.php file is that define('SQL_CACHE_METHOD', 'database'); is define('SQL_CACHE_METHOD', 'none'); in the tempstore.

14 Dec 2008, 9:33 PM
#15
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Download error no matter what. (File not found)

The "ERROR - could not create symlink" is a result of the PHP command which attempts to create the symlink receiving a failure notice from the operating system. Thus, this suggests that your /pub/ folder is not writable by the php/apache process.

14 Dec 2008, 9:47 PM
#16
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Hm.

I actually get the same symlink error message in by temp store, but in that store downloading is just fine... And download by redirect is set to YES in that store also.. This is strange...

15 Dec 2008, 12:37 PM
#17
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

Well...

Now I've reinstalled Zen Cart.

I have backup of everything and I made a new database for the new install. I thought I would reconfigure the configure files when everything were installed and all the modification were in place, so that the new install is pointing at the old database with all the customers and configuration.

So. I install. I remodificate. I put up a test file. I make a new customer, the first one in this new database. I buy. I download. Success!

Then. I reconfigured the configures to point at the old database. Everything is in place. All the customers, configurations. Hurray!.
I try the test user and buy the test produkt. I DON'T download.
Failure.

What?

There is something in the old database file that makes Zen Cart NOT want anyone to download products.

The mods I have is:
ajax_poststed (automatic city input from postage number during registration)
bankdeposit-mod-v1
editor_fceditor_2.6 (this is completely new, this is not causing any faults)
newsletter_subscribe 2-1-0
super_orders_2-0rev46 (I have a feeling it might has something with this one, I don't know)
zen-cart_norwegian_v1.3.8a_rev2 (this one has been with us from the beginning)

The download error has always been there I think. I can't remember not having that error. It is just now that it is critical to have in working.

Well.. Thats all for now.

15 Dec 2008, 1:09 PM
#18
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

I have located the issue. Almost. In the old database I removed the configuration table. Then I pasted the configuration table from the new database. Now everything works. I just have to configure Zen Cart. But customers and everything is in place. All the files is there, so when I configure everything again, things just pop into place =)

15 Dec 2008, 7:49 PM
#19
solvenus avatar

solvenus

New Zenner

Join Date:
Dec 2008
Posts:
24
Plugin Contributions:
0

Re: Download error no matter what. (File not found)

FOUND THE PROBLEM!

When I turn Gzip compression ON, downloads fails.

Then I turn Gzip compression OFF, downloads works =).

I would like to be able to use gzip compression, how do I work around this?

17 Dec 2008, 12:34 AM
#20
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Download error no matter what. (File not found)

GZip won't cause symlinks to not be properly created.