Is the attribute for uploading a file only for images? I would like customers to be able to upload a text file or maybe a MS Word document. Is there a way to associate file types that are acceptable to upload (ie., .doc, pdf, .txt, etc.)?
-Melissa
Is the attribute for uploading a file only for images? I would like customers to be able to upload a text file or maybe a MS Word document. Is there a way to associate file types that are acceptable to upload (ie., .doc, pdf, .txt, etc.)?
-Melissa
Miss Charlotte's Handmade Crafts
Zen Cart 1.3.8a
Ok, I finally found the answer to my question. I just couldn't remember where to find file types accepted to upload. It's under "Configuration", "Maximum Values" and then "Allowed Filename Extensions for uploading". I added the filename extensions I needed.
-Melissa
Miss Charlotte's Handmade Crafts
Zen Cart 1.3.8a
Glad you found it. It's easy to set.
But the upload function is buggy. I still haven't been able to make the upload required.
And if a user tries to upload an unacceptable file type associated with a product, the error message displays in the cart... where the product has already been added.
Franck
Last edited by Franck; 24 Aug 2008 at 08:06 PM.
Thanks for replying. Do you know the file extension for a MS Word 2007 document? When I look under the file properties, it just says "MS Word Document". I've tried the .doc extension and the file is being rejected when I try to add it to my shopping cart for testing purposes.
-Melissa
Miss Charlotte's Handmade Crafts
Zen Cart 1.3.8a
Yippie! Word 2007 uses the XML file format and uses the extension .docx. The file is no longer being rejected. I double checked and I can read the file too! It never hurts to check whether or not the file was saved without being corrupted.
-Melissa
Miss Charlotte's Handmade Crafts
Zen Cart 1.3.8a
When you say the wrong file exension was rejected, can you tell me where the system was catching the error. If you choose a PDF file, for example, and then click Add To Cart, what happens? Does the error stop you on the product information page, or do you get directed to the Cart page with the item in the cart and NO FILE uploaded?
This is the glitch I was referring to. If you're getting another behavior, I'd love to hear how it's working for you.
Franck, did you ever figure out a way to make an upload required?
I'm in the same boat as you...without a logo the order is basically incomplete, so I'd really like to make it required.
Congratulations are due to the ZC developers for missing this one out. Whats the point of a file upload if no-one can view it!!
![]()
You can view it - I use the image/file upload on a few sites.
Basically you need to make the upload folder read/writeable (I also added an htaccess file to this folder)
Then zen cleverly remanes the files and tells you the image name (if you look at the order placed with the file/image is attached to you'll see it there
Then you simply go to http://www.mywebsite.co.uk/images/ze...g(/gif/doc/pdf) then right click and save.
Of if you have ftp access simply download.
Easy peasy!
Hey,
I have used the following method to make a link in my orders page to the image, however I have 11 different upload attributes (long story) and this creates a rather unsightly bit of code which isn't very flexible.
The code now looks as follows:
Obviously this would be 1,000,000's of times better if it had one "if" statement, which checked if the product_option_type was "file" and then did the same process. Does anyone know how to modify this?PHP Code://echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br(zen_output_string_protected($order->products[$i]['attributes'][$j]['value']));
echo '<br><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ';
if (($order->products[$i]['attributes'][$j]['option'] == "1") or ($order->products[$i]['attributes'][$j]['option'] == "2") or ($order->products[$i]['attributes'][$j]['option'] == "3") or ($order->products[$i]['attributes'][$j]['option'] == "4") or ($order->products[$i]['attributes'][$j]['option'] == "5") or ($order->products[$i]['attributes'][$j]['option'] == "6") or ($order->products[$i]['attributes'][$j]['option'] == "7") or ($order->products[$i]['attributes'][$j]['option'] == "8") or ($order->products[$i]['attributes'][$j]['option'] == "9") or ($order->products[$i]['attributes'][$j]['option'] == "10") or ($order->products[$i]['attributes'][$j]['option'] == "1.")){
$full_logo_name = $order->products[$i]['attributes'][$j]['value'];
$pieces = explode(".", $full_logo_name);
echo ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '/images/uploads/' . $pieces[0] . '.' . $pieces[2] . '" target="_blank">' . nl2br($order->products[$i]['attributes'][$j]['value']) . '</a>';
} else {
ORIGINAL METHOD: