Crash1hd
02-06-2007, 12:30 AM
Hello All,
I have a form that allows a user to enter there name email address subject and text area for comments I attached a spot to upload an image to be attached to the email. Yet I am having trouble with the image showing up on the other end in the email as a .dat file (phpXuBK7g.dat)??? here is some of the code that does this
<form enctype="multipart/form-data" method="post" action="http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'].'">
Filename:
<br />
<input type="file" name="filename" size="30" />
<input type="submit" name="submit" />
</form>
mosMail($_POST['*request_email'], $_POST['*request_name'], email@email.com', Submission', $body, 1 ,'','',$_FILES['filename']['tmp_name']
mosMail calls phpMail and sends the attachment which works.
the other questions I have are follows?
If I do
echo "<PRE>";
print_r($_POST);
echo "</PRE>";
nothin shows up for the input type file? (I thought it was in FF and not IE but now it doesnt show in FF either)? Wondering if anyone can explain why its not showing up?
If I do
echo "<PRE>";
print_r($_FILE);
echo "</PRE>";
then I get information like
Array
(
[oFile1] => Array
(
[name] => image8.jpg
[type] => image/pjpeg
[tmp_name] => /tmp/phprVw2s6
[error] => 0
[size] => 40241
)
)
so I know its there but if I do
echo "<img src=\"".$_FILE['oFile1']['tmp_name']."/".$_FILE['oFile1']['name']."\">
nothing shows up?:confused:
I have a form that allows a user to enter there name email address subject and text area for comments I attached a spot to upload an image to be attached to the email. Yet I am having trouble with the image showing up on the other end in the email as a .dat file (phpXuBK7g.dat)??? here is some of the code that does this
<form enctype="multipart/form-data" method="post" action="http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'].'">
Filename:
<br />
<input type="file" name="filename" size="30" />
<input type="submit" name="submit" />
</form>
mosMail($_POST['*request_email'], $_POST['*request_name'], email@email.com', Submission', $body, 1 ,'','',$_FILES['filename']['tmp_name']
mosMail calls phpMail and sends the attachment which works.
the other questions I have are follows?
If I do
echo "<PRE>";
print_r($_POST);
echo "</PRE>";
nothin shows up for the input type file? (I thought it was in FF and not IE but now it doesnt show in FF either)? Wondering if anyone can explain why its not showing up?
If I do
echo "<PRE>";
print_r($_FILE);
echo "</PRE>";
then I get information like
Array
(
[oFile1] => Array
(
[name] => image8.jpg
[type] => image/pjpeg
[tmp_name] => /tmp/phprVw2s6
[error] => 0
[size] => 40241
)
)
so I know its there but if I do
echo "<img src=\"".$_FILE['oFile1']['tmp_name']."/".$_FILE['oFile1']['name']."\">
nothing shows up?:confused: