Thursday, April 16, 2015

ALTERNATE SOLUTION FOR "FAKEPATH" PROBLEM IN CHROME WHILE UPLOADING IMAGES AND FILES USING WAMP*.

I have been working on my wamp using javascript and jquery. One day i tried to upload an image using "input type='file' " but the browser is not allowing me to store the image path, i tried and tried and finally i got an alternate for this problem(not solution)


1)create a folder in the wamp->www->your_file_name(in my case) and put your images inside it.
2) by using the input type="file" just get the filename instead of whole path, either user js split like below:
split('fakepath\\')[1];
3) now while storing in the db just append the "http://localhost/your_file_name/" to the image.
Not only the images you can put the pdf files ..etc.


Hope this helps to solve the problem temporarily.

Krishh.

No comments:

Post a Comment