Results 1 to 7 of 7
  1. #1
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default how to add file upload to contact us page?

    Hi,

    I know this question has been asked before but i have read pages of threads and most are old and end with no definite answer.

    what I would like to do is simply add a upload file option to the contact us form. the file could be stored in a specified folder and then the regular email sent maybe with a modification saying that a file has been uploaded. if anyone has a simple solution to just adding an upload file option to the contact us form please let me know.

    thank you

  2. #2
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: how to add file upload to contact us page?

    the reason this is necessary is because I will be modifying the contact us form to be a new define_page that will be a request a quote form. this i know how to do. the customer will be able to put in their info and upload a spreadheet including the quantity vendor and part#. the reason for having a file upload would be so the customer can attach a excel spreadsheet. I do not need the file to be sent as an attachment although if it is possible that would be great but a simple file upload to a location on my server and an email saying it has been uploaded with customer info is all.

  3. #3
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: how to add file upload to contact us page?

    also i found this function zen_draw_file_field() could this be used?

  4. #4
    Join Date
    Mar 2009
    Posts
    89
    Plugin Contributions
    0

    Default Re: how to add file upload to contact us page?

    It's always a bit of a risk allowing anyone to upload files to your server so be careful and read up so you know what you are doing. This isn't specifically a zencart issue. If you google for php file upload you will find out more information.

    It might be a little more complicated than you perhaps think it is, you could always try elance or odesk

  5. #5
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: how to add file upload to contact us page?

    well I managed to do it. I ended up replicating the contact us page as a new page called request_quote. form there I modified the form for my needs and the instructions above. threw out anything I didnt need and replaced contact us instances with my new page name and FILENAME constant. after that I found a nice jquery php upload plugin that does ajax uploads of multiple files also has some pretty neat features. i inserted that in my new page after the form and specified its upload folder in the code. now I am able to upload a file with one click status bar appears and show that the file has been uploaded after that the user just hits send as usual and they never even notice that it was 2 separate forms. I then added a phrase in the email which specified a file has been uploaded and the usual contants that they enter. if anyone needs more detail or code just ask.

  6. #6
    Join Date
    Jun 2012
    Posts
    2
    Plugin Contributions
    0

    Default Re: how to add file upload to contact us page?

    HI warroyo90,

    I'm keen to do the same, could you please give me some details?
    1. Where did you add the new copy of *contact_us*
    2. How did you tell "zen cart" about your new php files?

    Thanks, Pubs

  7. #7
    Join Date
    Jan 2012
    Posts
    59
    Plugin Contributions
    0

    Default Re: how to add file upload to contact us page?

    sorry for the late response...

    so to create a copy of the contact us page follow this tutorial (kind of) ...http://www.zen-cart.com/wiki/index.p...ting_new_pages . so this tutorial shows how to create a new page in zen cart (very helpful by the way) look in the directories specified to add new files and you will find ones labeled contact_us transfer them to your computer and change the names to lets say upload_file so you would have :
    (make sure to be consistent with naming...)

    includes/modules/pages/upload_file/header_php.php(keep this the same) just change folder name before header_php.php to your new name
    includes/templates/yourtemplate/templates/tpl_upload_file_default.php
    includes/extra_datafiles/upload_file.php(you will have to edit some of the defines in this page)
    includes/languages/english/upload_file.php(alos modify defines to fit your needs)

    now you should have a page www.yoursite.com/index.php?main_page=upload_file

    it shoudl look just like the contact us page.

    now you can edit the info in tpl_upload_file_default to fit what you need. as for the upload part its a bit of a hack but works.

    I used a ajax upload script https://github.com/valums/file-uploader download the files place the js in includes/modules/pages/upload_file/
    place the css in your templates css folder labeled upload_file.css

    this will ensure the js and css are only loaded on that page

    next create a folder in somewhere in your structure called uploadPhp or soemthing and add the upload php file that was contained in the download in the same folder create a folder called uplaods or something of the sort.

    go into the upload.php file and go to the bottom of the file and change the uplaod directory to the name of that folder ex. uploads/

    next open the tpl_upload_file_default.php file and instantiate the file uploader and create a div in the page with the proper id

    u should now have a working file upload

    I even added a hidden input field that says a file has been uploaded to the server so the email that i get lets me know I have a file

    hope this works for you let me know if you have any questions

 

 

Similar Threads

  1. when using file upload how can I display loading message/page?
    By focus360 in forum Setting Up Categories, Products, Attributes
    Replies: 8
    Last Post: 30 Jul 2016, 04:45 PM
  2. Add a upload module on contact us page
    By als88 in forum All Other Contributions/Addons
    Replies: 15
    Last Post: 16 Jun 2012, 07:57 PM
  3. allow file upload on contact us page
    By bluelightnin6 in forum General Questions
    Replies: 5
    Last Post: 13 Jan 2012, 01:00 AM
  4. How to add fields in the contact us page?
    By rainmist in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 13 Dec 2008, 12:36 PM
  5. how to add phone to contact us page?
    By keylesslocks in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Aug 2008, 11:41 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR