Picture file lock after write image to an excel file

Technical support for Spire.XLS

Moderators: iceblue support, Flash, Manager

Picture file lock after write image to an excel file

Postby bruce.luk » Wed Jan 11, 2012 11:23 am

hi Support
I am using asp.net to write a picture to an excel file.
I get a problem that such original picture file is locked by w3wp.exe process after excel is saved.
Please help. Thanks
Bruce
bruce.luk
 
Posts: 10
Joined: Wed Dec 21, 2011 1:53 am

Re: Picture file lock after write image to an excel file

Postby Suvi.Wu » Thu Jan 12, 2012 6:47 am

Hello Bruce,

Sorry for the inconvenience caused by us and thank you for your inquiry. We simulated what you did(using asp.net to write a picture to an excel file), it works well. Would you please send us more informations to help us reproduce the issue? I also attached you the simple demo, please have a look.

Thanks in advance.
Have a great day.

BR
Suvi
e-iceblue support team
Attachments
308PicLock.7z
(149.26 KiB) Downloaded 308 times
User avatar
Suvi.Wu
 
Posts: 156
Joined: Thu Oct 20, 2011 2:53 am

Re: Picture file lock after write image to an excel file

Postby bruce.luk » Thu Jan 12, 2012 9:26 am

hi Suvi,

I have sent an email to you describe the problem details. Please check whether you have received it.
Write picture to excel function works well. But the file will then be locked by web server w3wp.exe process. The file cannot be deleted unless we restart the IIS application pools.

Please help.

Thanks
Bruce
bruce.luk
 
Posts: 10
Joined: Wed Dec 21, 2011 1:53 am

Re: Picture file lock after write image to an excel file

Postby Suvi.Wu » Tue Jan 17, 2012 6:17 am

Hello Bruce,

Sorry for this inconvenience caused by us and thank you for your patience with our support team.

We have sent you an E-mail to solve this problem. Please check your E-mail.

Have a great day.

BR
Suvi
e-iceblue support
User avatar
Suvi.Wu
 
Posts: 156
Joined: Thu Oct 20, 2011 2:53 am

Re: Picture file lock after write image to an excel file

Postby bruce.luk » Tue Jan 17, 2012 9:04 am

hi Suvi,

Received your email. Thanks for your follow up. It works for your suggested coding.

However, i cannot find the way to add multiple pictures in the same file. Please suggest.

Thanks & Best Regards,
Bruce
bruce.luk
 
Posts: 10
Joined: Wed Dec 21, 2011 1:53 am

Re: Picture file lock after write image to an excel file

Postby bruce.luk » Tue Jan 17, 2012 11:54 am

hi Suvi, Harry,

Thank you for your suggested solution.
The coding works.

Best Regards,
Bruce
bruce.luk
 
Posts: 10
Joined: Wed Dec 21, 2011 1:53 am

Re: Picture file lock after write image to an excel file

Postby harry.support » Thu Jan 19, 2012 1:47 am

You are welcome.
Please let us know if you have any other question.
Harry
Technical Support / Developer,
e-iceblue Support Team
User avatar
harry.support
 
Posts: 180
Joined: Mon Nov 08, 2010 3:11 pm

Re: Picture file lock after write image to an excel file

Postby 1030072 » Fri Mar 31, 2017 9:12 am

hi Support,

i also have the same issue " the file will then be locked by web server w3wp.exe process. ",
would you kind give the solution..

Thanks.
Best Regards.
1030072
 
Posts: 1
Joined: Thu Mar 30, 2017 2:33 am

Re: Picture file lock after write image to an excel file

Postby Betsy.jiang » Fri Mar 31, 2017 9:38 am

Dear 1030072,

Thanks for your inquiry.
Here is a solution which may solve your issue, please have a try.
Code: Select all
Workbook wb = new Workbook();
Worksheet ws = wb.Worksheets[0];
String path = Server.MapPath("/adorable.jpg");
using (System.IO.FileStream stream = System.IO.File.OpenRead(path))
{
ws.Pictures.Add(1, 1, stream);
wb.SaveToFile(Server.MapPath("/test.xls"));
}

If the issue still persists, please provide us following information for investigation.
1)Input files.
2)The code you were using.
3)OS informtaion.

Thanks,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 2095
Joined: Tue Sep 06, 2016 8:30 am

Re: Picture file lock after write image to an excel file

Postby Betsy.jiang » Wed Apr 05, 2017 9:16 am

Dear 1030072,

How is the issue now ?
I will appreciate it if you could give us some feedback.

Thanks,
Betsy
E-iceblue support team
User avatar
Betsy.jiang
 
Posts: 2095
Joined: Tue Sep 06, 2016 8:30 am


Return to Spire.XLS

Who is online

Users browsing this forum: No registered users and 0 guests

cron