CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> Archive -> CodeChargeStudio.Discussion

 file upload CCS1.0.7 PHP

Print topic Send  topic

Author Message
Maris Kalnins
Posted: 03/04/2003, 11:08 AM

Hi!

Is there a way to make text field able to function as file upload field
just by changing type="text" to type="file" in html template

Doing this way it loses the field text value :(

What is the solution for CCS 1.0.7?

Thanks

Maris Kalnins
Posted: 03/04/2003, 12:17 PM

Got it!
In php you need to use $_FILES['fieldname'] array


// if $_FILES['img1'] isn't empty, try to copy the file
if ($_FILES['img1'] != "") {

// copy the file to a directory or
//die and print an error message

// NOTE! if you're on a Windows machine,
// use Windows pathnames, like so:
// copy($_FILES[img1][tmp_name],
"C:\\some\\directory\\path\\".$_POST[img1_name]);

copy($_FILES['img1']['tmp_name'],
"/your/directory/path/".$_FILES['img1']['name'])
or die("Couldn't copy the file!");

} else {

// if $_FILES['img1'] was empty, die and let us know why
die("No input file specified");

}

"Maris Kalnins" <proximus@e-teliamtc.lv> wrote in message
news:b42tjm$781$1@news.codecharge.com...
> Hi!
>
> Is there a way to make text field able to function as file upload field
> just by changing type="text" to type="file" in html template
>
> Doing this way it loses the field text value :(
>
> What is the solution for CCS 1.0.7?
>
> Thanks
>
>


   


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

MS Access to Web

Convert MS Access to Web.
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.