CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 File Upload path into database

Print topic Send  topic

Author Message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message
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
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.