Jump to content

Archived

This topic is now archived and is closed to further replies.

faani

PHP file handling help me!

Recommended Posts

$uploaddir = "/".$countryList."/";
echo ($uploaddir);
$file_name = "uploadfile";
function file_upload( $file_name, $uploaddir){

$uploadfile =  $uploaddir . $_FILES[$file_name]['name'];
if (@move_uploaded_file( $_FILES[ $file_name ]['tmp_name'], $uploadfile)) {

} else
{
echo( $_FILES[ $file_name ]['name'] . " Does not uploaded successfully:\n");
}
}

Share this post


Link to post
Share on other sites
Ok... calm down and don't panic.

I'll need a little more information.
Is there an error message to go with this?
Are you running in windows / solaris / linux / etc?

You most probable problem is your first line:

[code]$uploaddir = "/".$countryList."/";[/code]

try replacing it with:

[code]$uploaddir = $countryList."/";[/code]

Alternatively check your permissions on the folder in question.

Share this post


Link to post
Share on other sites
Ok first, please do not post the same question twice. As it is against the posting rules. Please read the forum posting guid lines.. Now I think that you may want to have a look at this simple [url=http://www.tizag.com/phpT/fileupload.php]file upload tutorial[/url]

Good Luck,
Tom

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.