Jump to content

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!

flashmonkey@rediffmail.com

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.