osCmax v2.5 User Manual
Results 1 to 10 of 10

Pdf Upload for contact page

This is a discussion on Pdf Upload for contact page within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Just wondering if there is a contribution that would allow a user to attach a pdf to the contact form ...

      
  1. #1
    New Member
    Join Date
    Sep 2008
    Posts
    14
    Rep Power
    0


    Default Pdf Upload for contact page

    Just wondering if there is a contribution that would allow a user to attach a pdf to the contact form and email.

    i have had a search look but cant see anything suitable

    many thanks!!!

  2. #2
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Pdf Upload for contact page

    Sorry - there is no available mod on the catalog side to allow files to be uploaded. For the Contact Us and About - this could be a BIG security issue. If you do add this - make sure you restrict the types of files. Maybe put some kind of limit of how many time one can upload a file. As well most servers may limit the size of file (about 2MB if I remember correct)
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  3. #3
    New Member
    Join Date
    Sep 2008
    Posts
    14
    Rep Power
    0


    Default Re: Pdf Upload for contact page

    would you recommend a sendmail page (that i can insert using the dynamic pages) with an upload? I agree, the file field will be restricted to .pdf, .jpg & .gif files and approx 2mb limit to file size#

    this would also allow a fast update to any additional information the client wishes to add (they are picky one!)

    sound like the correct solution or would there be any pitfalls to this approach?

    thanks for the quick reply

  4. #4
    Member
    Join Date
    Oct 2008
    Posts
    31
    Rep Power
    0


    Default Re: Pdf Upload for contact page

    If you did it that way, how would you get it into the shopping card to buy?

  5. #5
    New Member
    Join Date
    Sep 2008
    Posts
    14
    Rep Power
    0


    Default Re: Pdf Upload for contact page

    the pdf upload isnt to buy, it is just for enquiries sake
    the client sells retail display solutions and has asked for the functionality for a user to email them a pdf or photo of the space available etc

    based on that i think this solution would be viable?

  6. #6
    Member
    Join Date
    Oct 2008
    Posts
    31
    Rep Power
    0


    Default Re: Pdf Upload for contact page

    I am trying to do something simillar to you, only I need it to be added to a cart. I have no solution.

  7. #7
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Pdf Upload for contact page

    I could see a PDF being uploaded as like "official purchase order" or "sample graphic". There are places on the net to find sample code to add this. I will look later today.
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  8. #8
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Pdf Upload for contact page

    A little bit of googleing....

    in your html or template files put the following HTML code or simular
    Code:
    <form enctype="multipart/form-data" action="upload.php" method="POST">
    Please choose a file: <input name="uploaded" type="file" /><br />
    <input type="submit" value="Upload" />
    </form>
    upload.php
    PHP Code:
    <?php
    // a private directory of where you want files uploaded to
    $target "upload/";
    $target $target basename$_FILES['uploaded']['name']) ;
    $ok=1;

    //This is our size condition
    if ($uploaded_size 350000) {
      echo 
    "Your file is too large.<br>";
      
    $ok=0;
      }

    //This is our limit file type condition
    if (!($uploaded_type=="application/pdf")) {
      echo 
    "You may only upload pdf files.<br>";
      
    $ok=0;
      } 

    //Here we check that $ok was not set to 0 by an error
    if ($ok==0) {
      Echo 
    "Sorry your file was not uploaded";
      }

    //If everything is ok we try to upload it
    else {
      if(
    move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) {
        echo 
    "The file "basename$_FILES['uploadedfile']['name']). " has been uploaded";
      } else {
        echo 
    "Sorry, there was a problem uploading your file.";
      }
    }
    ?>
    I take no credit - this is straight from: PHP File Upload - PHP Upload Script - Upload file script

    You may have to modify and edit as necessary.
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

  9. #9
    Member
    Join Date
    Oct 2008
    Posts
    31
    Rep Power
    0


    Default Re: Pdf Upload for contact page

    Cool. Anyway to add it to a cart now?

  10. #10
    jpf
    jpf is offline
    osCMax Testing Team
    jpf's Avatar
    Join Date
    Sep 2003
    Location
    Manitoba, Canada
    Posts
    2,699
    Rep Power
    22


    Default Re: Pdf Upload for contact page

    The original post was to add it to a contact form. That should be not hard to do with the code above. However to have as an ATTRIB - then no - far from that.

    I am looking at other options for the future version of MAX (not current beta- as that is closed for changing features).
    JPF - osCMax Fourm Moderator - To contact, post on the forum or click here
    Try out our osCMax at: Live Catalog Demo
    Limited access Admin: Live Admin Demo
    Feel free to add products they way you want and then purchase them -=+=- Sorry nothing will be billed or shipped!

Similar Threads

  1. .php missing from contact us and about us page
    By louisk1974 in forum osCommerce 2.2 Installation Help
    Replies: 0
    Last Post: 07-15-2008, 07:08 AM
  2. Contact US Page being SPAMMED
    By Impreza25r in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 02-18-2006, 04:37 PM
  3. add a field to contact us page
    By stevensdesign in forum osCMax v1.7 General Mods Discussion
    Replies: 1
    Last Post: 08-01-2005, 03:37 AM
  4. What to add Contrib for contact us page
    By Kristine in forum osCmax v1.7 Discussion
    Replies: 2
    Last Post: 04-08-2004, 01:31 PM
  5. adding to the contact up page?
    By Kristine in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 03-25-2004, 03:58 AM

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
  •