Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Contact Us - Want to add Attachments


Recommended Posts



In contract_us.php module I would like to add the functionality to allow a user to click on a 'add attachment' button so they can attach a document and send it along with their email.


Does anyone have code that does this?





Link to comment
Share on other sites

Does anyone have code that does this?

yes and this code available in google as well.

Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Link to comment
Share on other sites



It is not just as simple as added a Browse button to the contact_us.php file. You also have to make a database table, upload directory and admin access to the files.


I was thinking that you MAY be able to modify the Customer Testimonials contribution ( http://addons.oscommerce.com/info/5477 ) to suit your needs as it will cover all aspects of what you require, you would just have to change the customer_testimonials.php to integrate it into the contact_us.php


Just a thought.





Link to comment
Share on other sites

Ugh I just went through this process.. it is NOT easy to mail an attachment.. You are better off using an uploads script, and have the file upload to a folder and the email sends you a link to the file..


Also, the contactus uses javascript / ajax I believe.. and you can not upload files with ajax and then have the php do the email.. I found that out quickly. You need to pass the variable to the server php page and then call the javascript inside of the php page to display a thankyou message..


What are you trying to do exactly?? Because there is a product you can setup with a file upload option.. that might be better for you

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!


HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you


Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

I had to make this modification for uploading Tax Exempt Forms.


My fix was to use PHPforms to generate a form for the upload, then use javascript to popup a new window for upload which contained said code. It worked perfectly. With Database administration and email notifications it was the perfect solution. Surely you could do the same for the contact us form.


Just an idea, I'd link you to the form generator I used but it is paid and that isn't allowed, just PM me if you would like the link, and I'd be happy to give you the javascript to make a nice pretty popup as well.

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...