Zen Cart Logo
Forums / General Questions / upload file excel

upload file excel

Views: 1,113

Results 1 to 8 of 8
12 Jun 2015, 7:17 PM
#1
pixel1987 avatar

pixel1987

New Zenner

Join Date:
Dec 2014
Location:
uruguay
Posts:
65
Plugin Contributions:
0

upload file excel

I want to upload an Excel file and when i ll click in Catalog I download the file

I do not know how to do it

12 Jun 2015, 9:28 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: upload file excel

zip it and upload via FTP to your /downloads folder
add it as a download to a product or create a standard html link to it in the product description

15 Jun 2015, 6:30 PM
#3
pixel1987 avatar

pixel1987

New Zenner

Join Date:
Dec 2014
Location:
uruguay
Posts:
65
Plugin Contributions:
0

Re: upload file excel

kobra:

zip it and upload via FTP to your /downloads folder
add it as a download to a product or create a standard html link to it in the product description

thanks :
upload via ftp understand, but as I do the rest for example Catalog by clicking the user automatically download it

15 Jun 2015, 10:31 PM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: upload file excel

as I do the rest for example Catalog by clicking the user automatically download it
A link to this rest

30 Jun 2015, 7:16 PM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: upload file excel

Do you know how to construct basic HTML? This is what is being inferred. If you don't know how to construct a basic hyperlink then it would be a good idea to learn, as a knowledge of basic HTML can help solve many issues. W3Schools has some good tutorials.

30 Jun 2015, 10:00 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: upload file excel

pixel1987:

thanks :
upload via ftp understand, but as I do the rest for example Catalog by clicking the user automatically download it
Where on your website will the customer/user click to download the Excel file? Is the file a product (that is, the customer must pay before they download) or does the file contain additional information that the customer might want?

2 Jul 2015, 12:50 PM
#7
pixel1987 avatar

pixel1987

New Zenner

Join Date:
Dec 2014
Location:
uruguay
Posts:
65
Plugin Contributions:
0

Re: upload file excel

the user should not pay anything is just an excel my website to download

2 Jul 2015, 1:58 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,069
Plugin Contributions:
56

Re: upload file excel

You'll start out by storing (via FTP upload) your Excel files in your store's /media folder.

To be able to successfully download those files, you'll need to edit the file /media/.htaccess to allow those file types to be accessed (see the changes in red):

#
# @copyright Copyright 2003-2010 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version $Id: .htaccess 16954 2010-07-21 22:55:30Z drbyte $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################

# deny *everything*
<FilesMatch ".*">
  Order Allow,Deny
  Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch ".*\.(mp3|mp4|swf|avi|mpg|wma|rm|ra|ram|wmv|epub[B]|xls|xlsx[/B])$" >
  Order Allow,Deny
  Allow from all
  
  # tell all downloads to automatically be treated as "save as" instead of launching in an application directly
  # (just uncomment the next 2 lines by removing the '#'):
#  ForceType application/octet-stream
#  Header set Content-Disposition attachment
</FilesMatch>

IndexIgnore */*


## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
# OPTIONS -Indexes -ExecCGI

Once that change has been made and the file is present in the /media folder, you'll add the following HTML code wherever you want the customer to download a file:

<a href="media/yourexcelfile.xls" target="_blank">Some Text Describing the File</a>