Page 1 of 2 12 LastLast
Results 1 to 10 of 259

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Posts
    40
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    I received an email back from the UPLOAD-POINT in regards to selecting only certain file extensions to be uploaded and this was his reply. I have not used it yet, but wanted to pass it on to those who wanted to used it.

    Hello Ladybugmom,

    Sorry so long to reply, I've been out of town.

    The latest version (1.62 Beta) does not have an easy fix. This is because of the addition of the ability to upload multiple files at once. The version before (1.61 Beta) is essentially the same, has an easy fix, but doesn't allow multiple files to be uploaded at once.

    I've had many requests for this, but I've not had any free time for a while to try to work on it. A user has sent his fix for 1.62 Beta if you want it, but it's pretty long and may have a few minor problems.

    I'm sorry I couldn't have been of more help, but I truly have not had any time to work on it lately.

    Regards,
    Todd

    The easy ;) fix to 1.61 Beta is this:
    Code:
    In index.php after line 306 is: // Path from domain name to upload 
    directory and line 315 is: // Redirect to upload page. 
     
    Replace the current code between these lines with this: 
     
    $file_ext = basename($_FILES['ftp_file']['name']); 
    $ext = substr($file_ext, strrpos($file_ext, '.') + 1); 
    $upload_dir = ($_SERVER['DOCUMENT_ROOT'] . "/$fileupload_dir_name/"); 
    $target_path = $upload_dir . basename( $_FILES['ftp_file']['name']); 
    if (($ext == "ai") || ($ext == "eps") || ($ext == "psd") || ($ext == 
    "pdf") || ($ext == "png") || ($ext == "gif") || ($ext == "tif") || ($ext 
    == "rar") || ($ext == "7z") || ($ext == "zip")) { 
      if (move_uploaded_file($_FILES['ftp_file']['tmp_name'], $target_path)) { 
      chmod($upload_dir . basename( $_FILES['ftp_file']['name']), 0644); 
      echo $p."$l_upload13 ". basename( $_FILES['ftp_file']['name']). "$p2"; 
      } else { 
      echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2"; 
      } 
    } else { 
      echo $p."$l_upload14 ". basename( $_FILES['ftp_file']['name']). "$p2"; 
    } 
     
    The new line 311: 
    if (($ext == "ai") || ($ext == "eps") || ($ext == "psd") || ($ext == 
    "pdf") || ($ext == "png") || ($ext == "gif") || ($ext == "tif") || ($ext 
    == "rar") || ($ext == "7z") || ($ext == "zip")) { 
     
    is where you can add or remove file types. If you just want .jpg files 
    then it should be: 
    if (($ext == "jpg")) {

  2. #2
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    Hi Ladybugmom

    Since my last post, I did a developer-tool-kit search for "upload" and "upload_files" etc and discovered the following zen cart files both provide for extensions:

    admin\includes\classes\upload.php
    includes\classes\upload.php

    which function with

    admin\mail.php
    admin\media_manager.php

    As I am not good with php, the problem remains how to incorporate these snippets into your mod.

    However, your fix may save me a lot of bother. With the limitation of only applying to one file uploaded at a time, I suppose a little note to the uploader may cater to situations where more than one file is to be uploaded.

    I imagine one can upload one file after another by multiple pressings of the "Upload your file" button before finally pressing the send button for the form. If this is the case, the form should provide a place to list the files so uploaded.

    Best Regards

  3. #3
    Join Date
    May 2010
    Posts
    2
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Hi.
    I have a question. I'm using Zen Cart and want to add three contact forms. I have looked trough php form tutorial and found how forms are created. I just want to know how I can implement them with Zen Cart. Sorry for my bad knowledge in programming and thanks in advance.

  4. #4
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    This is just what I've been looking for, but I'm trying to incorporate it into a defined page via the define pages editor.

    I basically copied the entire code from the http://www.silkblooms.co.uk/upload/data/index.php file and pasted it into this page:

    http://www.silkblooms.co.uk/index.ph...e=testimonials

    Needless to say, it don't work :)

    I'm assuming it's because the 'upload' folder is not relative to the testimonial files? Would an easy way of fixing this be to move the upload folder into a relative position? If so, does anyone know where to?

    I'm a complete amateur, if anyone knows a better way of incorporating this upload file function into a defined page then please share a technique with me. I'm very keen to have this function.

  5. #5
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    I am not exactly clear on what you want to do.

    If Evilbr.png is a file that you uploaded, then the mod does work ipso facto.

    IIRC the Upload folder must be placed outside of your cart for security reasons.

  6. #6
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Ignore my previous post, I was just talking gibberish. All I had to do was insert the page into an IFrame. It's working now, at http://www.silkblooms.co.uk/index.ph...e=testimonials

    My next question is now in line with the last few posts in this thread. How on earth do we prevent users from uploading .exe and .php malicious files?

    I see that rolling back to v.1.61 is a quick fix, but I'd really like to keep the multiple file upload function. I've conversed with the mod author and he's basically saying it's not an easy fix using the php commands he's used to fix 1.61.

    Does anyone know if there's a way of using a .htaccess file to prevent the upload of certain file types?

  7. #7
    Join Date
    Jan 2007
    Location
    Los Angeles, California, United States
    Posts
    10,021
    Plugin Contributions
    32

    Default Re: custom forms - data collection

    Quote Originally Posted by limelites View Post
    Ignore my previous post, I was just talking gibberish. All I had to do was insert the page into an IFrame. It's working now, at http://www.silkblooms.co.uk/index.ph...e=testimonials

    My next question is now in line with the last few posts in this thread. How on earth do we prevent users from uploading .exe and .php malicious files?

    I see that rolling back to v.1.61 is a quick fix, but I'd really like to keep the multiple file upload function. I've conversed with the mod author and he's basically saying it's not an easy fix using the php commands he's used to fix 1.61.

    Does anyone know if there's a way of using a .htaccess file to prevent the upload of certain file types?
    Suggest using the example posted earlier in this post for how to put your form in the proper Zen Cart format, and NOT to use an iframe for your form..
    My Site - Zen Cart & WordPress integration specialist
    I don't answer support questions via PM. Post add-on support questions in the support thread. The question & the answer will benefit others with similar issues.

  8. #8
    Join Date
    Jan 2009
    Posts
    2,123
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    I'm quite happy with the iFrame though, it seems to do the trick.

    All I need is to figure out how to maintain multiple file uplaods, without compromising security.

  9. #9
    Join Date
    Sep 2010
    Posts
    612
    Plugin Contributions
    0

    Default Re: custom forms - data collection

    Quote Originally Posted by DivaVocals View Post
    Suggest using the example posted earlier in this post for how to put your form in the proper Zen Cart format, and NOT to use an iframe for your form..
    Hi Diva,

    I know this is an old post but you've been an amazing help with my other issues...so I thought I'd see if you could help.

    I'm trying to create a form for data submission, I don't know what the heck I'm doing. I've managed to duplicate the contact us page and add the fields I want. However, when I submit I don't know what happens.

    I don't need it validated, it would be nice but seeing that I don't know how to code forms it's not necessary. I just want a simple submission form. Any ideas? Thank you!!!

  10. #10
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    984
    Plugin Contributions
    6

    Default Re: custom forms - data collection

    Quote Originally Posted by limelites View Post

    My next question is now in line with the last few posts in this thread. How on earth do we prevent users from uploading .exe and .php malicious files?
    If you limit the file types to .jp*g, *.png, *.txt, *.rtf and *.pdf, you should have no problem.

    See post #179 for where to put this.

    Basically, I created a new page based on this band signup mod, to which I added the Upload Point code. No iFrame required.

    If you want your testimonials page to automatically create itself from user inputs, I think you are in for a lot more work to maintain the appropriate controls..

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. custom survey forms
    By cpk in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 2 May 2011, 05:07 PM
  2. Custom Forms
    By wwiii in forum General Questions
    Replies: 3
    Last Post: 11 May 2009, 05:51 PM
  3. Customer's seeing other users' data in forms
    By erikcw in forum General Questions
    Replies: 5
    Last Post: 30 Jan 2008, 11:30 PM
  4. Custom Collection of Attribute Data
    By Fastcar in forum General Questions
    Replies: 0
    Last Post: 15 Jan 2008, 01:01 PM
  5. Custom Forms - Help?
    By TurtleDove in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 9 Jun 2006, 02:46 AM

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