java - In a Spring MVC Hibernate Application , image path is getting changed from jsp to controller class? -


in spring mvc hibernate app , selecting image jsp , sending controller , image path getting changed because of getting file not found error... this jsp code :

 <form name="reguserform">     <input type="file" name="userimage" id="userimage"/>  </form>  

here selecting image d: drive d:\25986.jpeg

and below controller class code :

 public string reguser(@requestparam("userimage") file userimage) {     system.out.println("image  =  "+ userimage);   }   

// here getting : image = c:\fakepath\25986.jpeg

because of cannot procced.
dont know why image path getting changed automatically. should change input type image ? me ?

suppose did want, , suppose use webapp, , choose upload image k:\documents\jbnizet directory. k:\documents\jbnizet\someimage.jpg argument method. useful for? file path on end-user's machine (my machine) doesn't represent meaningful on webapp server (your machine).

read spring mvc's documentation understand how must handle file uploads.


Comments

Popular posts from this blog

All overlapping substrings matching a java regex -

c++ - Using OpenSSL in a multi-threaded application -

php - Deleting/Renaming a locked file -