Jump to content

NEED URGENT HELP!


flashmonkey

Recommended Posts

My image upload script has suddenly stopped working. I tried a lot of things but then i found that my hosting providers have disabled 'allow_url_fopen' for security concerns. I'm stuck with my users unable to upload their images. Is there a way around. Any help will be highly appreciated. Here is the code:


$register = $_POST['submit'];

if(isset($register)){

$photo_name = $_FILES['photo1']['name'];

$photo_type = $_FILES['photo1']['type'];

$photo_size = $_FILES['photo1']['size'];

$photo_temp_name = $_FILES["photo1"]["tmp_name"];

$photo_error = $_FILES["photo1"]["error"];

$target_path = "http://www.loveisinair.com/home/loveisin/public_html/upload1/".basename($photo_name);

$upload =move_uploaded_file($photo_temp_name, $target_path);

if(empty($upload)){

$error = "Error: Your image did not upload.";

}


Thanks in advance!

[email protected]

Link to comment
https://forums.phpfreaks.com/topic/83058-need-urgent-help/
Share on other sites

I'm pretty sure move_uploaded_file doesn't support URLs x.x lol.....  You might want to consider using a local path.

 

Yeah i thought that too but didnt want to sound daft lol

 

you would have to move locally then fopen/fputs to upload to server to FTP

 

 

Liam

Link to comment
https://forums.phpfreaks.com/topic/83058-need-urgent-help/#findComment-422504
Share on other sites

Archived

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

×
×
  • Create New...

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.