Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

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


Gasse1014life

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

Link to comment
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

Link to comment
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

Link to comment
Share on other sites

  • 4 months later...
  • 3 months later...

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

Link to comment
Share on other sites

  • 2 weeks later...

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

Link to comment
Share on other sites

  • 1 year later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...