Debt Consolidation - Wordpress Themes - Debt Consolidation - Debt Consolidation - Play Piano by Ear

PDA

View Full Version : PHP Upload between http & https Not working


Ian
Oct 15th 2008, 2:39 pm
I have a site located at:

http://www.mysite.com/file/

I have the administration section located at:

https://www.mysite.com/admin

In the admin section I have an area to upload files, but I want them to load into the http://www.mysite.com/file/ folder, which is located on the http side, not the secured section.

But I continue to get an error doing so.

Here's the code:

<?

$target = "/home/httpd/vhosts/mysite.com/httpdocs/file/";
$target = $target . basename( $_FILES['uploaded']['name']) ;

$name = basename($_FILES['uploaded']['name']);

if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "Your File: ". basename( $_FILES['uploadedfile']['name']). " has been uploaded.";
}
else {
echo "Upload Failed.";
}
?>

It works just fine when it's in the non-secure portion, it just can't post accross for some reason. However, I don't want to have to post from the secure area into the non-secure area, as I'm sure there's just something I'm missing.

Thanks in advance and I appreciate whatever assistance anyone can give.

Ian

EricBruggema
Oct 15th 2008, 10:57 pm
Try using print_r to view the content of $target! :)