Azure - WebSites - java.io.FileNotFoundException: image.jpg (Access is denied) -


i having problem azure websites. using java receive image webservice, same app in test environment doesn't throw exception, when upload azure, brokes.

file file = new file("image.jpg");  fileoutputstream outputstream = new fileoutputstream(file.getname());  //this happens ==> java.io.filenotfoundexception: image.jpg (access denied) 

i found link, explains solutions php asp.net, in java tryed paths:

d:\\home\\site\\wwwroot\\app_data\\image.jpg d:\\program files (x86)\\apache-tomcat-7.0.50\\image.jpg 

without success!

someone me?

for issue, if you'd store file azure website file system, please try use path :

      //store file        private static final string save_dir = "webcontent\\upload";       //write code servlets       // gets absolute path of web application       string apppath = request.getservletcontext().getrealpath("");       // constructs path of directory save uploaded file       string savepath = apppath + file.separator + save_dir;       // creates save directory if not exists       file filesavedir = new file(savepath); 

and can read file using same path. on azure website, if directly used path "image.jpg", file maybe store root path of jvm started. azure website can deny file path security. think can try use full path access file. also, you can check file system via ftp.

however, according experience, if want store persist file in azure website, azure blob storage may best choice.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -