• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 342
  • Last Modified:

Webform and Mailer.php not sending images

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
kentgorrell
Asked:
kentgorrell
1 Solution
 
dsmileCommented:
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
 
kentgorrellAuthor Commented:
Yep that was it. Just right clicked on it via Filezilla and made the changes.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now