Jump to content



Photo
- - - - -

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

all extension is allowed :p

  • Please log in to reply
9 replies to this topic

#1   Gasse1014life

Gasse1014life
  • Members
  • 96 posts
  • Real Name:stephane

Posted 22 September 2011 - 05:46

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.. /smile.png' class='bbc_emoticon' alt=':)' />


the add on will be ready in 24 hours

i know a lot of people will be happy /tongue.png' class='bbc_emoticon' alt=':P' />

enjoy

#2   Gasse1014life

Gasse1014life
  • Members
  • 96 posts
  • Real Name:stephane

Posted 23 September 2011 - 05:54

http://addons.oscommerce.com/info/8161

#3   Gasse1014life

Gasse1014life
  • Members
  • 96 posts
  • Real Name:stephane

Posted 24 September 2011 - 04:21

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

#4   drhigham

drhigham
  • Members
  • 12 posts
  • Real Name:Dave Higham
  • Gender:Male

Posted 28 September 2011 - 04:15

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

#5   foolingaround

foolingaround
  • Members
  • 4 posts
  • Real Name:Andrew Stallone

Posted 21 February 2012 - 22:58

Hello

What does this addon do?

#6   Gasse1014life

Gasse1014life
  • Members
  • 96 posts
  • Real Name:stephane

Posted 20 June 2012 - 23:32

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

#7   Gasse1014life

Gasse1014life
  • Members
  • 96 posts
  • Real Name:stephane

Posted 20 June 2012 - 23:35

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.

#8   1qay1qay

1qay1qay
  • Members
  • 23 posts
  • Real Name:Gp baterije
  • Gender:Male

Posted 30 June 2012 - 21:30

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

#9   psytanium

psytanium
  • Members
  • 154 posts
  • Real Name:Ludwig Arcache
  • Gender:Male

Posted 07 March 2014 - 19:12

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

#10   psytanium

psytanium
  • Members
  • 154 posts
  • Real Name:Ludwig Arcache
  • Gender:Male

Posted 07 March 2014 - 20:50

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.