FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Problem with attaching file (from a form) to email in PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Problem with attaching file (from a form) to email in PHP [message #172783 is a reply to message #172782] Tue, 01 March 2011 02:58 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 2/28/2011 9:33 PM, Cameleon wrote:
> Thanks Jerry,
>
> thanks for the advice, but there is a lot more sanitizing done (found
> that already...), I just simplified the code for the forum. Worked
> for the<> ... stupid me, need new glasses!
>
> one last (I hope) question if you still want...
>
> 1) seems it doesn't want to access the file that I want to attached
> (posted from the form... see code below)
>
>
>
> // ATTACHENMENT INFOS
> $UploadedFile_name = $_FILES["UploadedFile"]["name"];
> $UploadedFile_type = $_FILES["UploadedFile"]["type"];
> $UploadedFile_size = $_FILES["UploadedFile"]["size"];
> $UploadedFile_temp = $_FILES["UploadedFile"]["tmp_name"];
>
>
> ive tried:
>
> $mail->AddAttachment(file_get_contents($UploadedFile_name));
>
> and
>
> $mail->AddAttachment($UploadedFile_name);
>
> with no success...
>
>

Look at the data in your $_FILES array:

print_r($_FILES);

Note that the file is initially stored using the tmp_name, not the file
name (in case of conflicts). So until you actually move the file with
move_uploaded_file() (which you need to do on some OS's anyway), the
file won't exist under the permanent name.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: SOCIAL NETWORK FOR PHP PLATFORM..
Next Topic: HTML select field where the OPTION text is of different colors
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 19:37:21 GMT 2024

Total time taken to generate the page: 0.04213 seconds