Jump to content
Gasse1014life

File Upload and Display_V2.01.69 for version V 2.3.x

Recommended Posts

hi allllll

 

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.. :)

 

 

the add on will be ready in 24 hours

 

i know a lot of people will be happy :P

 

enjoy

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for this contribution, but I can't seem to get it to work.

  • The file isn't uploading to the server when I press "Save" in the edit product page.
    • In your instructions you didn't mention anything about creating a folder for the files to be uploaded to, do I need to create a folder named "Manuals" in the Catalog folder?
    • and edit configure.php's to include "define('DIR_WS_MANUALS', 'manuals/'); define('DIR_WS_CATALOG_MANUALS', DIR_WS_CATALOG . 'manuals/');" and "define('DIR_FS_CATALOG_MANUALS', DIR_FS_CATALOG . 'manuals/');"
    • Do I need to anything else not included in the instructions regarding uploading pdf's?

Many thanks,

Dave

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for this contribution, but I can't seem to get it to work.

  • The file isn't uploading to the server when I press "Save" in the edit product page.
    • In your instructions you didn't mention anything about creating a folder for the files to be uploaded to, do I need to create a folder named "Manuals" in the Catalog folder?
    • and edit configure.php's to include "define('DIR_WS_MANUALS', 'manuals/'); define('DIR_WS_CATALOG_MANUALS', DIR_WS_CATALOG . 'manuals/');" and "define('DIR_FS_CATALOG_MANUALS', DIR_FS_CATALOG . 'manuals/');"
    • Do I need to anything else not included in the instructions regarding uploading pdf's?

Many thanks,

Dave

 

 

yes was my error,

 

you need to edit admin and catalog configure.php to put these lines,,

 

"define('DIR_WS_MANUALS', 'manuals/');

"define('DIR_WS_CATALOG_MANUALS', DIR_WS_CATALOG . 'manuals/');"

"define('DIR_FS_CATALOG_MANUALS', DIR_FS_CATALOG . 'manuals/');

 

and create the Manuals folder into the catalog. with permissions 755.

 

 

thank for the info and ill make an upgrade packages.

 

have a nice day

Share this post


Link to post
Share on other sites

Hello

 

What does this addon do?

 

 

this add-on is an extra file upload field and allow you to upload any file for each product in catalog, and linked to catalog in product_info.php.

 

same as images download but for others extension.

Share this post


Link to post
Share on other sites

Thanks for excellent contribution !

 

small errata for implementation docs in admin categories.php :

 

At step 7 replace

 

<td class="main"><?php echo File_Upload; ?></td>

 

with

 

<td class="main"><?php echo TEXT_PRODUCTS_PDFUPLOAD; ?></td>


Baterije & Akumulatorji OsCommerce store

Share this post


Link to post
Share on other sites

Hello, how can we delete an already uploaded pdf file? thx

 

anyway to delete an already uploaded file ???

 

I have done this by changing

if (isset($HTTP_POST_VARS['products_pdfupload']) && tep_not_null($HTTP_POST_VARS['products_pdfupload']) && ($HTTP_POST_VARS['products_pdfupload'] != 'none')) {
  $sql_data_array['products_pdfupload'] = tep_db_prepare_input($HTTP_POST_VARS['products_pdfupload']);
}

to

$sql_data_array['products_pdfupload'] = tep_db_prepare_input($HTTP_POST_VARS['products_pdfupload']);

 

and change

tep_draw_input_field('products_previous_pdfupload'

to

tep_draw_input_field('products_pdfupload'

 

now to remove an uploaded file, just empty the upload text field.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×