Contributions
File Upload and Display_V2.01.69 for version V 2.3.x
after one month of work i have finnally finnish the PDF and all file upload via admin for product_info page.
for version 2.3.x
i have reduce script at his more simple expression to ability of anyone to modify code and show it if not null anywhere it the catalog.
at this time i have only put a link in product info.php page to see the file who have been upload in admin ,
but it can be modify to be put in any code like flashvar or swf etc...
with this tag" $product_info['products_fileupload'] or $pInfo->products_pdfupload "
this add on have been test with 11 others addon install at the same time without any error, (SQL or Php)
if you have any question it will be a pleasure to help you to resolve your problem..
Expand All / Collapse All
put this code anywhere u want link to be appear
<?php
if ($product_info['products_pdfupload'] == '') {
// echo '<a href="' . tep_href_link(DIR_WS_MANUALS. $product_info['products_pdfupload']) . '"target="_blank">' . TEXT_CLICK_TO_PDFUPLOAD2 . '</a>';
} else {
echo '<a href="' . tep_href_link(DIR_WS_MANUALS . $product_info['products_pdfupload']) . '"target="_blank">' . TEXT_CLICK_TO_PDFUPLOAD . '</a>';
}
echo '<br>';
if ($product_info['products_fileupload'] == '') {
// echo '<a href="' . tep_href_link(DIR_WS_MANUALS . $product_info['products_fileupload']) . '"target="_blank">' . TEXT_CLICK_TO_FILEUPLOAD2 . '</a>';
} else {
echo '<a href="' . tep_href_link(DIR_WS_MANUALS . $product_info['products_fileupload']) . '"target="_blank">' . TEXT_CLICK_TO_FILEUPLOAD . '</a>';
}
?>
I have forgot to do a fix to allow all ext to be upload,
but u can set only the wanted ext. to be upload.
catalog/admin/includes/classes/upload.php
function upload($file = '', $destination = '', $permissions = '777', $extensions = array('jpg','png')) {
only add ext you want to...
and dont forget for some security reason , change 777 to 755
*******************************
in same file ,search for :
if (!is_writeable($this->destination)) {
replace by:
if (!tep_is_writable($this->destination)) {
*******************************
i have reverse the max file size upload to a min file size upload to allow any file size..
in the same file search for :
if ( tep_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) && ($file['size'])<150000) {
replace by :
if ( tep_not_null($file['tmp_name']) && ($file['tmp_name'] != 'none') && is_uploaded_file($file['tmp_name']) && ($file['size'])>100) {
*******************************
NOW its PERFECTLY workin on ALL v2.3 version of oscommerce.
sorry to the pertubation let me another 24 n i will do a new package.
for now the file is attach to this post, use at your own risk.
cheer
after one month of work i have finnally finnish the PDF and all file upload via admin for product_info page.
for version 2.3.x
i have reduce script at his more simple expression to ability of anyone to modify code and show it if not null anywhere it the catalog.
at this time i have only put a link in product info.php page to see the file who have been upload in admin ,
but it can be modify to be put in any code like flashvar or swf etc...
with this tag" $product_info['products_fileupload'] or $pInfo->products_pdfupload "
this add on have been test with 11 others addon install at the same time without any error, (SQL or Php)
if you have any question it will be a pleasure to help you to resolve your problem..
Note: Contributions are used at own risk.