File Upload Required addon [Support Thread]
Allows a file attribute (optionally) to be required, similar to text attributes.
Errors resulting from insufficiently large values of post_max_size and upload_max_filesize are handled and errors resulting from failed upload attempts now prevent products from being added to the basket.
Cautions and advice regarding the setting of post_max_size and upload_max_filesize in relation to Maximum File Upload Size in the Zen Cart admin are displayed at the top of the Zen Cart admin if the settings are detected to be inappropriate.
Under Admin->Catalog->Attributes Controller the option "Attribute Required for Text" is changed to "Attribute Required for File/Text".
Download Link: http://www.zen-cart.com/index.php?ma...oducts_id=1685
Please report any bugs/issues here
Thank you,
sj
Re: File Upload Required [Support Thread]
sj,
I just installed 1.3.9g fresh, then I carefully followed your installation instructions.
When I add go to the Attribute Controller, Add an Option then Insert (regardless of what is selected, addeded, etc). I'm getting a page with a single "f" displayed. Nothing in the Page Source, either.
Any ideas?
Re: File Upload Required [Support Thread]
I found the problem. The includes/languages/english/attributes_controller.php file had an 'f' as the first character of the file. Deleted it and we're good.
Re: File Upload Required [Support Thread]
Ok... The Admin side works. I can require the upload field.
Now when I test the cart (using the classic "out of the box") cart (No other modules installed), I'm getting another blank screen when I "add to cart" with or without an uploaded file. Page source is blank.
Re: File Upload Required [Support Thread]
Found the problem... I had made a minor modification to the upload.php file. By comparing the original with the new I was able to find my error. Sorry!
Re: File Upload Required [Support Thread]
Common bug:
The file upload is not required and a required text upload is also not required (check this if you are still not able to require the file upload). The item is simply added to the basket despite the text upload/file upload being required.
Possible Cause:
Missing database entries (not sure what causes this).
Solution:
-> Backup your database
-> Check that the following lines are missing from your database
-> Use "Admin->Tools->Install SQL Patches" to install the missing lines.
PHP Code:
INSERT INTO `configuration` VALUES ('', 'Product option type Select', 'PRODUCTS_OPTIONS_TYPE_SELECT', '0', 'The number representing the Select type of product option.', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Upload prefix', 'UPLOAD_PREFIX', 'upload_', 'Prefix used to differentiate between upload options and other options', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Text prefix', 'TEXT_PREFIX', 'txt_', 'Prefix used to differentiate between text option values and other option values', 0, NULL, '2007-03-19 17:57:39', '2007-03-19 17:57:39', NULL, NULL);
INSERT INTO `configuration` VALUES ('', 'Image Handler Version', 'IH_VERSION', '2.0', 'This is used by image handler to check if the database is up to date with uploaded image handler files.', 0, 100, NULL, '2007-06-06 16:47:03', NULL, 'zen_cfg_textarea_small(')
Thank you to grantc for this fix.
Original post:
http://www.zen-cart.com/forum/showpo...3&postcount=20
Re: File Upload Required [Support Thread]
Is this line supposed to be run if you don't use IH2?
PHP Code:
INSERT INTO `configuration` VALUES ('', 'Image Handler Version', 'IH_VERSION', '2.0', 'This is used by image handler to check if the database is up to date with uploaded image handler files.', 0, 100, NULL, '2007-06-06 16:47:03', NULL, 'zen_cfg_textarea_small(')
Re: File Upload Required [Support Thread]
Re: File Upload Required [Support Thread]
Having a bit of an issue: After installing, I am able to require the upload however, after creating new (non-file related) options am unable to set values for the new option. Recieve a duplicate entry error.
I created the Upload option first and it's ID is therefore '1'. it appears that any additional names are also given the ID of '1' when attempting to add option values and therefore a duplicate of the first named option (at least that's what it seems to be). Even though the option name is given a unique ID, in the option values it seems to always be '1'.
This is the error that appears:
1062 Duplicate entry '1-1' for key 1
in:
[insert into zen_products_options_values (products_options_values_id, language_id, products_options_values_name, products_options_values_sort_order) values ('1', '1', 'testing', '3')]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
Also, no matter what type of option I choose, they all show up as TEXT in the settings for the Attribute Controller.
Any ideas where the problem might lie (operator error or otherwise)?
Thanks
Re: File Upload Required [Support Thread]
Problem Solved... I thought above issue was a problem associated with the "File Upload Required," however it was a database issue where deleted options were not removed from the database...
Thanks to DrByte (and his input in the regular forum) I was able to cure the issue...
Run this from SQL Patches in the Tool menu:
delete from products_options_values where products_options_values_id > 0;