Page 6 of 6 FirstFirst ... 456
Results 51 to 57 of 57
  1. #51
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    would

    PHP Code:
    $file_name $_FILES[$key]['name']; 
    get me the name of the uploaded file?

  2. #52
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    PHP Code:
            $name_pre 'test';
            
    $file_name $_FILES[$key]['name'];  
        
    $file_ext basename($_FILES[$key]['name']); 
        
    $ext substr($file_extstrrpos($file_ext'.') + 1); 
    my question is, if I add something to the beggining of $file_name do i need to re add the extension or would it still retain the extension?

    PHP Code:
    $filename $name_pre $file_name
    would that work, or would I have to put the extension back on the end?

  3. #53
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    this doesn't work Warning: no file uploaded.

    PHP Code:
    $att_array = array();
        foreach(
    $_FILES as $key => $file) {
        
    $folderid 'test';
        
    $imagefolder DIR_FS_UPLOADS;
        
    $folderPath $imagefolder $folderid;
        
    $name_pre 'test';
            
    $file_name = ($_FILES[$key]['name']);  
        
    $file_ext basename($_FILES[$key]['name']); 
        
    $ext substr($file_extstrrpos($file_ext'.') + 1);
        
    $filename 'test';  
      if (
    zen_not_null($_FILES[$key]['tmp_name'])) {
        
    $exist is_dir($folderPath);
        if(!
    $exist) {
            
    mkdir("$folderPath");
            
    chmod("$folderPath"0755);
        }
         
    $upload = new upload
            
    $upload->set_file $key;
          
    $upload->set_destination $folderPath;
        if (
    $upload->parse() == true) { 
            
    $upload->set_filename $filename
         
    $att_array[] = array('file' => $upload->destination $upload->filename'name' => $upload->filename);
           
    $upload->save();
        } else {
      
    //die('could not manage uploads');
    }
      }


  4. #54
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    it is uploading, but it is uploading to the root directory

  5. #55
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    figured it out... silly me, will post new code shortly

  6. #56
    Join Date
    Mar 2009
    Posts
    609
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    to enable file uploading from ios devices that name all files as image.jpg, i've set the image rename to be microtime as i was worried rand might clash, and then I would need a check for if the file already existed, this method seemed simpler.

    PHP Code:
    $att_array = array();
        foreach(
    $_FILES as $key => $file) {
        
    $folderid 'test';
        
    $imagefolder DIR_FS_UPLOADS;
        
    $folderPath $imagefolder $folderid;
        
    $name_pre microtime();
        
    $file_name = ($_FILES[$key]['name']);  
        
    $file_ext basename($_FILES[$key]['name']); 
        
    $ext substr($file_extstrrpos($file_ext'.') + 1);
        
    $filename = ($name_pre '.' $ext);  
      if (
    zen_not_null($_FILES[$key]['tmp_name'])) {
        
    $exist is_dir($folderPath);
        if(!
    $exist) {
            
    mkdir("$folderPath");
            
    chmod("$folderPath"0755);
        }
         
    $upload = new upload
            
    $upload->set_file($key);
          
    $upload->set_destination($folderPath);
        if (
    $upload->parse() == true) { 
            
    $upload->set_filename($filename); 
           
    $upload->save();
         
    $att_array[] = array('file' => $upload->destination $upload->filename'name' => $upload->filename);
        } else {
      
    //die('could not manage uploads');
    }
      }


  7. #57
    Join Date
    Aug 2020
    Location
    Richarson
    Posts
    94
    Plugin Contributions
    0

    Default Re: Adding Multiple Images to Custom form To be sent to Admin Email

    Wow, I realize it's been years since anyone has commented on this thread but I happen to come across it while searching for a way to create a form that will allow multiple images to be uploaded. Is this the latest and greatest thread for working to resolve this puzzle? Any input would be appreciated. I am currently using 1.5.7c.

    Thanks in advance.

 

 
Page 6 of 6 FirstFirst ... 456

Similar Threads

  1. v139h New Contact Form Email - Messages not being sent?
    By jazzyman in forum General Questions
    Replies: 9
    Last Post: 6 Feb 2013, 05:28 PM
  2. email address - sent from, multiple emails
    By illusionest in forum Basic Configuration
    Replies: 2
    Last Post: 10 Nov 2010, 02:18 AM
  3. Adding Multiple Images though Admin that also works with zen lightbox 1.4
    By headyntl in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 3 Jul 2008, 07:58 AM
  4. EMail Admin the same Email message that is sent to customer
    By dubya01 in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Aug 2007, 03:47 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR