The real filename is stored in the database ... to avoid overlaps ... it is saved to the server as a numeric filename ...
The real filename is stored in the database ... to avoid overlaps ... it is saved to the server as a numeric filename ...
Linda McGrath
If you have to think ... you haven't been zenned ...
Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!
Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here
Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!
Thanks for the info Linda. I decided to use a copy of Innova's Asset Manager for viewing & managing the uploads form the admin area. Works like a charm and the client is happy!
Where can I get Innova's Asset Manager for viewing & managing the uploads form the admin area. I really need this for my client as well.
I also wanted to find out how or where I would set the upload attribute so the browse button is under the text field instead of being to the right of it. Help would be much appreciated.
I dont understand why the file uploaded by the customer cannot be opened by the shop sales team in the Admin/orders area?
In our case, when a trophy is ordered the shop staff log onto admin/customers/orders and can view the item, engraving & size requirements (attributes) and also need to see the uploaded image of the logo required - I shouldnt have to give them FTP access in order to do this.
thanks to zincxxx for recommending Innova's Asset Manager, i'll have to go searching for it ASAP!
DOH! just my luck I havent been able to find this asset manager thingy! Could anybody tell us where to find it or something similar??
Or are there any code mods anyone here has done to allow customer uploaded files to be opened in admin panel?
There must be lots of people who require this function...
thanks for any help
Okay, I found a modification on the OcCommerce forums to add a link to view the file/image from the edit order function in admin
http://forums.oscommerce.com/lofiver...p/t202695.html
I've gotten to the point where it doesn't throw any errors, but it still doesn't display a link either.
I added this this a file under admin/includes/extra_configures
define('DIR_WS_CATALOG_IMAGES_UPLOADS', DIR_WS_CATALOG_IMAGES .
'uploads/');
define('DIR_FS_CATALOG_IMAGES_UPLOADS', DIR_FS_CATALOG_IMAGES .
'uploads/');
I added this to a file under admin/includes/extra_datafiles/
define('TABLE_PRODUCTS_OPTIONS_TYPES', 'products_options_types');
Then in the orders.php, I tried to convert it to Zencart format from instructions I found online, but I must be missing something. This is what I have
if (isset($order->products[$i]['attributes']) && (sizeof($order->products[$i]['attributes']) > 0)) {
for ($j = 0, $k = sizeof($order->products[$i]['attributes']); $j < $k; $j++) {
// Customization #31101 for file_upload view begin
$option = $order->products[$i]['attributes'][$j]['option'];
## Build a query to check if this option is of 'File' Type
$file_check_sql = " select count(*) from ".TABLE_PRODUCTS_OPTIONS ." o,
".TABLE_PRODUCTS_OPTIONS_TYPES." ot WHERE o.products_options_type = ot.products_options_types_id AND products_options_types_name='File' AND o.products_options_name='".$option."'";
$file_check_sql = $db->Execute($file_check_sql);
$isFile = $file_check_sql->RecordCount();
if($isFile == 1 &&
@file_exists(DIR_FS_CATALOG_IMAGES_UPLOADS.$order->products[$i]['attributes'][$j]['value'])){
$link = "<a href=". DIR_WS_CATALOG_IMAGES_UPLOADS.$order->products[$i]['attributes'][$j]['value']." target='_blank'><i>Click to View</i></a>";
}else {
$link = "";
}
echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);
if ($order->products[$i]['attributes'][$j]['price'] != '0') echo ' (' . $order->products[$i]['attributes'][$j]['prefix'] . $currencies->format($order->products[$i]['attributes'][$j]['price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . ')';
if ($order->products[$i]['attributes'][$j]['product_attribute_is_free'] == '1' and $order->products[$i]['product_is_free'] == '1') echo TEXT_INFO_ATTRIBUTE_FREE;
echo ' '. $link.' </i></small></nobr>';
// Customization #31101 end
Should this be in another directory, like extra_functions rather than in the orders file? Can anyone tell why the link isn't displaying?
Can any Zen superstars help on this??
I'm certain it would be very helpful
This is probably really bad practice (but desperate mesures were needed)- but my client required access to ftp'd up images files so I simply removed the htaccess file from the uploads folder - now they simply type the site address http://www.siteaddress.co.uk/images/...s/filename.jpg
with the filename being specified on the customer order and they can then just get the image from the browser.
I would not recommned doing this with any sort of senstive/private information.
Continuing on the bad practice described above - I have changed the .htaccess file to allow access to the uploaded images from IP address of the store owner - and created a link on the edit order page to view the file. To do this on your site:
(using 1.3.5)
change line 401 of admin/orders.php FROM:
TO:Code:echo '<br /><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']);
Which results in something like this:Code:// echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . nl2br($order->products[$i]['attributes'][$j]['value']); echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': '; if ($order->products[$i]['attributes'][$j]['option'] == "Logo 1" || $order->products[$i]['attributes'][$j]['option'] == "Logo 2" || $order->products[$i]['attributes'][$j]['option'] == "Logo 3" || $order->products[$i]['attributes'][$j]['option'] == "Logo 4" || $order->products[$i]['attributes'][$j]['option'] == "Logo 5") { $full_logo_name = $order->products[$i]['attributes'][$j]['value']; $pieces = explode(".", $full_logo_name); echo nl2br($order->products[$i]['attributes'][$j]['value']) . ' <a href="/images/uploads/' . $pieces[0] . '.' . $pieces[2] . '" target="_blank">View ' . $pieces[0] . '.' . $pieces[2] . '</a>'; } else { echo nl2br($order->products[$i]['attributes'][$j]['value']); }
Logo 1: 4. joomla_logo_black.jpg View 4.jpg
The above only works because the Option Name for uploaded images is "Logo 1" through "Logo 5". If the Option Name for your uploaded file is different, then change those names. It will also fail if there is more than one "." in a filename - but I'm not sure Zen-Cart would allow it to be uploaded.
It currently works on my site, but no guarantees. Hope this helps some people - its not a full uploaded file editor, but it will allow unskilled store admins to at least see the uploaded files referenced without typing a bunch of stuff.
Last edited by boylan; 6 Nov 2006 at 08:45 AM.
I'm desperately searching for a solution to my problem: My products require customers to upload files (customized merchandise).
But Zen Cart 1.3.8 allows customers to put items in the cart without the mandatory upload. No test for the upload seems to be run, even though the attribute is "Required".
Can anyone help, please?
Many thanks!