Click here to Skip to main content
16,012,316 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
server local path is working +unc path is not working for reading the file+wcf service
Posted
Comments
Anuja Pawar Indore 30-Jan-12 8:33am    
To lazy to write the question even
nareshgundapaneni 30-Jan-12 8:38am    
hi Anuja Pawar Indore,
No, i am getting the problem like that only that's why i given simple if you wont more details i can give.
thanks,
Naresh.G

Refer this thread, might help you. Or give more details, what you are trying
http://stackoverflow.com/questions/5871021/wcf-svclog-to-unc-path[^]
 
Share this answer
 
Comments
nareshgundapaneni 30-Jan-12 8:55am    
Hi Anuja Pawar Indore,
this link you given that didn't help Anuja Pawar Indore.what i am doing is when user upload any file am saving in to server and reading barcode by using dtk barcodereder that i am doing,i can save the file but when i am trying read the file for reading barcode i am geting error called 'unable to open file for reading.

i am using iis server for hosting the wcf service.

thanks,
Naresh.G
Try this
C#
bool canImp = imp.ImpersonateValidUser(impUser, domain, impPwd);

                FileStream fs = File.OpenRead(filePath);
                logger.Debug("File stream opened...");
                byte[] b = new byte[fs.Length];
                fs.Read(b, 0, b.Length);
                fs.Close();
 
Share this answer
 
Comments
nareshgundapaneni 30-Jan-12 9:36am    
if i give like this it is working:d:/image/1.png

if i give like this it is not working //server1/image/1.png.i can open that file by start+run.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900