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
Solved

Webform and Mailer.php not sending images

Posted on 2011-09-21
2
335 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PHP query / monitor data from Telnet to MySQL 7 44
ajax to record click 3 16
Log in through ID 5 17
Html Newline 7 20
Find out what you should include to make the best professional email signature for your organization.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)

808 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