Solved

Webform and Mailer.php not sending images

Posted on 2011-09-21
2
332 Views
Last Modified: 2012-08-14
I'm using mailer.php (modifed) to send form data and an image file attachment
       $FileName = $GUID . "." . $FileExtension;
      $ImagePath = "images/" . $FileName;
       copy($ImageFile, $ImagePath);
      $Attachment = chunk_split(base64_encode(file_get_contents($ImagePath)));

It works on one website but not another.
I've made sure the folder "images" exists however the image doesn't seem to show up in this folder (it does on the good website) so I suspect the issue is not with mailer.php but rather it is that the form is not uploading the image.

Does the copy move the image or copy it? there is no sign of the original in any other folder on either website.

The form was created in Dreamweaver here is the snippet
        <tr>
          <td><div align="left">Upload Your Photo</div></td>
          <td><div align="left">
            <input type="file" name="Image_File" id="Image_File" />
          </div></td>
        </tr>
So why should it work on one website but not the other and what can I do to resolve this issue?
0
Comment
Question by:kentgorrell
2 Comments
 
LVL 13

Accepted Solution

by:
dsmile earned 500 total points
ID: 36577983
if the code is identical on both site, then you need to chmod folder images on the not-working-site to 0777 to allow php script to write to it.
In other words, try to set write permission for images folder
0
 

Author Closing Comment

by:kentgorrell
ID: 36578171
Yep that was it. Just right clicked on it via Filezilla and made the changes.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now