Welcome Guest, Not a member yet? Register   Sign In
[Solved] Saving Temp File Outside of Doc Root
#11

[eluser]quest13[/eluser]
I tried the same as you mentioned , but unlink() throws the following error, Any help in this regard ?

I loaded "$this->load->helper('file');" before applying unlink(), Is there anything else needed on this ?

Severity: Warning

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

Filename: models/test_model.php

Line Number: 1120
#12

[eluser]tomcode[/eluser]
Apparently You use unlink not with a file path but with an URL.
#13

[eluser]CoffeeBeanDesign[/eluser]
Indeed, unlink() only works with actual server paths -

Code:
unlink('c:/xampp/htdocs/myfile.txt');

or

Code:
unlink('../myfile.txt');

Otherwise, you could do :

Code:
unlink('http://codeigniter.com');
#14

[eluser]quest13[/eluser]
Thanks a lot. I was giving virtual path !
it is working great with physical path. But in spite of successful delete, it throws some error message. I suppressed it by @unlink. Will it harm anyway when being uploaded to Linux server later ?


Thanks to both of you for the fast response.
#15

[eluser]CoffeeBeanDesign[/eluser]
What was the error message??

I've personally found that whilst you can do a lot to make your local environment (xampp or whatever) match your production environment as much as possible there are inevitably slight adjustments you need to make. The error reporting on your local server may be different. You may be able to let this error go and not worry about it, for my part I'm normally super anal about errors and try to resolve them even if they are inconsequential. As a rule I don't like using @function() if I can avoid it.




Theme © iAndrew 2016 - Forum software by © MyBB