Image Upload Path |
[eluser]Felipe Deitos[/eluser]
Hi! I got a newbie question, actually everything is working but everytime i put the code from my localhost to webserver e need to change the separator of the path... take a look at the code: In every model that i need to delete images i have this: Code: var $image_folder; The image_folder in localhost returns C:\xampp\htdocs\www\something\assets\images\products so i need to use "\\". In webserver the image_folder returns http://www.something.com.br/assets/images/products and i need to use "/". Am i doing something wrong? What else can i do to stop changing this //\/\/\/\/\/\/\/\ everytime?
[eluser]jvicab[/eluser]
You can use DIRECTORY_SEPARATOR php constant to get the correct separator based on the OS: ussually Windows is '\' but LINUX is '/'
[eluser]Ckirk[/eluser]
Windows should be able to handle the "/". Mine does so I never have to change it on my local machine
[eluser]Felipe Deitos[/eluser]
Sorry for taking too long to give you guys one feedback. Yes, i was wrong... It works with backslash in both local and webserver... I really doesnt know what i was doing wrong, but now everything is working. Cheers everybody! |
Welcome Guest, Not a member yet? Register Sign In |