views:

24

answers:

1

My application was working fine but I don't know how suddenly allow_url_fopen set OFF in my php.ini , there is php.ini file in my ftp dir but when I execute phpinfo(); it gives all php.ini configuration information.I dont know how to set this ON.can anybody tell me the alternate way to my code-

$image_name=$unq.'.'.$extension;
$newname="album/".$image_name;
$copied = copy($_FILES['image']['tmp_name'], $newname); // here i get error

error: Warning: copy(album/6911139.jpg) [function.copy]: failed to open stream: Permission denied in D:\Hosting\6448289\html\upload.php

URL file-access is disabled in the server configuration in D:\Hosting\6448289\html\upload.php on line 112

please suggest me any alternat method. and is there any any command that I will execute and allow_url_fopen` will set ON ??

A: 

Copying an uploaded file to another location on the web server should never involve an URL. Not sure what's going wrong here - I can't see an URL anywhere.

Anyway, you should use move_uploaded_file() for this, not copy(). Try whether that works better.

Also try using an absolute path instead of the relative album/.....

Pekka
oh thanks Pekka its working.thanks alot...
nectar