[SOLVE] how to show pic that's we just upload

lazyyan 04 Jan, 2009
hi admin and chatter,
i just finished the upload form biodata with picture,
the pic was perfectly upload n save in database.
the problem is.. how to "calling back" the picture that;s i just upload and show it/display images as the result of my biodata form..

here the coding of upload form.
thank you
<div  class="form_item"><div class="form_element cf_fileupload"><label class="cf_label">Gambar upload</label><input class="cf_inputbox" size="20" id="file_0" name="file_0" type="file"></div><div class="clear"> </div></div><div  class="form_item"><div class="form_element cf_button"><input value="Submit" name="undefined" type="submit"><input value="Reset" type="reset"></div><div class="clear"> </div></div>

<td><?php echo $uploadedfile; ?></td>
GreyHead 04 Jan, 2009
Hi lazyyan,

Where do you want to display the files? If you have the file URI then you can display them using an <img. . .> tag in your html.

The files are saved by default in the com_chronocontact/uploads/{form_name} folder.

Bob
lazyyan 04 Jan, 2009
hi GreyHead, yes u are right the file will are saved by default in the com_chronocontact/uploads/{form_name} folder.

my queation is , how to automatically show after upload the images e.g after i finished upload pic a.jpg, then the result will display the images.
i dont have the script n no idea to do so.

are saved by default in the com_chronocontact/uploads/{form_name} folder.

i also done <img src="<? echo $file_0; ?>" width="346" height="474" /> On Submit code - after sending email:
(PHP code with tags) but not working. do u have any idea.

thank you
GreyHead 04 Jan, 2009
Hi lazyyan,

The file path is no longer in the field_name value. Try this in one of the OnSubmit boxes:
<?php
if ($debug) echo "attachments['file_1']: ".print_r($attachments['file_1'], true)."<br /><br />";
$file_path = str_replace( JPATH_SITE, '', $attachments['file_1']);
$file_path = str_replace( '\\', '/', $file_path);
$file_path = substr_replace($file_path, '',  0, 1);
echo "<img src='$file_path' />"
?>
All the replacements are to convert the image path into a URL that will work in the html.

Bob
lazyyan 04 Jan, 2009
hi GreyHead,
it';s work..
thank you for ur kinda help..
This topic is locked and no more replies can be posted.