CodeIgniter Forums
unlink error - don't know how to fix it - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: unlink error - don't know how to fix it (/showthread.php?tid=25601)



unlink error - don't know how to fix it - El Forum - 12-17-2009

[eluser]überfuzz[/eluser]
I get an errorwhen I try to unlink a pdf-file.
Quote:A PHP Error was encountered

Severity: Warning

Message: unlink() [function.unlink]: http does not allow unlinking

Filename: information/schema.php

Line Number: 109

How do I set the permission to 777 or something arbitrary when I upload it? I get 644 all the time. Hence I can't unlink.


unlink error - don't know how to fix it - El Forum - 12-17-2009

[eluser]CroNiX[/eluser]
http://php.net/manual/en/function.chmod.php

You should just change that directories permissions to 777, not the individual file.


unlink error - don't know how to fix it - El Forum - 12-17-2009

[eluser]überfuzz[/eluser]
I guess my post was somewhat vague. I'm trying to use the ftp class to alter the permissions. But nothing seems to happen with the files I'm aiming for...

Code:
$this->load->library('ftp');
$this->ftp->chmod($path, DIR_WRITE_MODE);

Edit, my the last post was not a reply to your post CroNiX. I didn't see it before I started scribble mine.


unlink error - don't know how to fix it - El Forum - 12-17-2009

[eluser]CroNiX[/eluser]
I havent used the ftp class, but in the documentation it has this example:
$this->ftp->upload('/local/path/to/myfile.html', '/public_html/myfile.html', 'ascii', 0775);

It looks like you can set the permissions using the 4th parameter.


unlink error - don't know how to fix it - El Forum - 12-17-2009

[eluser]BrianDHall[/eluser]
I could be wrong, but your error message doesn't indicate that you have a problem with permissions, it says http doesn't allow unlink, which is I believe the error when you do something like unlink('http://mysite.com/myfile') - which you can't do. You have to provide unlink() a link relative to your local filesystem or have one of the wrappers in PHP that allows some other functionality (but HTTP isn't ever an option with unlink), so make sure of that before you worry about chmod.


unlink error - don't know how to fix it - El Forum - 12-17-2009

[eluser]überfuzz[/eluser]
Thanx both of you! Your posts really helped me to sort things out.

The only, hopefully, error now is when I try to beef it up to take 5M size pdf files. My client wanted it!? When I check the server the file is there, but my script stops. When I checked the ini.php file it stated a 12M limit...