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
>
>
|
|
|
 |
|