softmafia
Posts: 44
|
| Posted: 08/13/2005, 12:29 PM |
|
Hello can anyone help me i designed an application and on it is an upload which i use to upload images
i want to be able to to upload images and at the same time write the link images/imagename.jpg to my database field i have been able to upload the file but i have not been able to inlude the folder link to the image
please can any one help
if i upload a picture it goes striaght to the folder but i need to include the image path with the image name when i am wrinting to the database colum for the image link
e.g INSERT into Table "images/boy.jpg"
how do i code the upload script to also write the image path with the name of the image
please don mind my repetations i just wanted you guys t understand
_________________
softmafia |
 |
 |
peterr
Posts: 5971
|
| Posted: 08/13/2005, 2:57 PM |
|
The FileUpload component automatically writes the image name to the database. File path is not needed and not recommended there. You can specify the path when implementing file download functionality, not upload.
There is an example of File Upload functionality in CCS Example Pack 2, also online at: http://examples.codecharge.com/CCSExamplePack2/FileUpload/FileUpload.php
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
softmafia
Posts: 44
|
| Posted: 08/14/2005, 8:14 AM |
|
Peterr thanks
but see if the upload only writes the file name into the database colum how then do i grid images that are in a particular folder with out the path written with the image in the database column???
please help
_________________
softmafia |
 |
 |
peterr
Posts: 5971
|
| Posted: 08/14/2005, 11:20 AM |
|
You'd just type the word "images" before the image in the grid. Take a look at the above example, which uploads files to the "files" folder - same case as yours.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
feha
Posts: 712
|
| Posted: 08/16/2005, 5:52 PM |
|
Hi here is code sample:
Before show event ...
function ddd_countries_BeforeShowRow()
{
$ddd_countries_BeforeShowRow = true;
//End ddd_countries_BeforeShowRow
//Custom Code @137-F13CB2C8
// -------------------------
global $ddd_countries;
// Write your own code here.
if(file_exists("../images/flags/".strtolower($ddd_countries->show_flag->GetValue()).".gif"))
{
$flag="../images/flags/".strtolower($ddd_countries->show_flag->GetValue()).".gif";
$ddd_countries->show_flag->SetValue("<img src=\"$flag\" border=\"0\">");
}
....
_________________
Regards
feha
www.vision.to
feedpixel.com |
 |
 |
softmafia
Posts: 44
|
| Posted: 08/17/2005, 10:31 AM |
|
Feha i dont really understand this you example can you explain and
petterr
thanks for your opinion i will try it and get back to you and please peter i uploaded the site to the internet but i am having problem with the file upload path am i corect if i use ../folder/images for the destination folder and also use ../temp for the temporary folder please
help me its working locally but its not working when i upload it
please help
thanks
_________________
softmafia |
 |
 |