• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Saving Temp File Outside of Doc Root

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

Apparently You use unlink not with a file path but with an URL.

Indeed, unlink() only works with actual server paths -




Otherwise, you could do :


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.

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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.