[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Webform and Mailer.php not sending images

Posted on 2011-09-21
2
Medium Priority
?
340 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
dsmile earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

649 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