@kumar.penigalapati,
I have reproduced attached file using your application as it is. Image is present in the output so could you take a look and let us know your feedback. Aspose Test Images.zip (40.4 KB)
Hi Ashan Iqbal,
I am getting the excel file like the one attached.
I am using windows 10 and even in our dev and test environments its not working they are running Windows server 2012 R2.
do you see any dependency on any of these or anything else ?
Aspose Test Images.zip (7.3 KB)
Also one more thing we observed that the its taking lot of time to create a excel files.
Hi Ashan Iqbal,
do you have any update on the issue ?
Thank you.
@kumar.penigalapati,
We are afraid that still no update is available in this regard. We are trying to get more information and will share immediately once ready for sharing.
@kumar.penigalapati,
Please add the following code to your web application:
ServicePointManager.SecurityProtocol = SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls;
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)0x300;
ServicePointManager.SecurityProtocol |= (SecurityProtocolType)0xC00;
Can you try it and let us know your feedback.
Hi Ahsan Iqbal,
No luck with this, still we are missing the images in excel.
Thank you.
@kumar.penigalapati,
In your web application, can you get image stream from the image https url in the html file?
Can you test it using your code and tell me the result?
Hi Ashan Iqbal,
i have tried export the html file with base64 as image source then i am able to export the files fine,
image urls are still an issue.
please see the attached file that i tired and out put excel file as well.WebApplication7.zip (8.3 MB)
Aspose Test Images2.zip (27.4 KB)
@kumar.penigalapati,
We have recorded this information into our database for further investigation. We will keep you updated here about any progress in this regard.
You can get the image stream from base64 source. But https url is not correct. So we think your web application has some security restrictions. The console program can get image stream, so the Aspose.Cells dll is working correctly. The reason may exist in your web application environment. You can test it using image with http url source. If you can get image stream, so your web application has some issues of getting https stream data.
Hi Amjad Sahi,
We are able to stream the image fine with in our we application.
When we put this url in our webpage the images are loading properly.
I am not sure if this could be the issue.
Hi Amjad Sahi,
I have attached the we application code where we have the image url in out Home/index page and we are able to see the image fine when we launch the app.
so that makes us believe we donβt block the stream.WebApplication7.zip (837.7 KB)
@kumar.penigalapati,
Thank you for sharing sample application. We will analyze it and share our feedback accordingly.
In your web application environment, can you get the image stream from https url using the following code?
e.g
Sample code:
WebRequest request = WebRequest.Create(href);
WebResponse response = request.GetResponse();
Stream responseStream = response.GetResponseStream();
if your web application is ok, you can get image stream. Can you try it?
Hi Amjad Sahi,
we have tried the example you have given, we were getting an error, i have attached the screen shot.
for some of those outside urls we have to use our proxy server to read them.
i have also attached a code which uses the proxy server if i use it then i am able to read the stream fine.
can you please let us know how we can use the proxy server via Aspose.Cells library so we can get the images stream ?Images-Stream.zip (258.5 KB)
Thank you.
Thanks for the screenshots.
We will evaluate your issue further and get back to you soon.
@kumar.penigalapati,
You can implement the IStreamProvider to set web proxy.
The sample code as follows:
HtmlLoadOptions options = new HtmlLoadOptions();
options.StreamProvider = new StreamProvider47584(proxyurl);
Workbook wb = new Workbook(filePath + "HtmlPage2.html", options);
wb.Save(filePath + "Page_out.xlsx");
class StreamProvider47584 : IStreamProvider
{
private string proxyUrl;
public StreamProvider47584(string url)
{
this.proxyUrl = url;
}
void IStreamProvider.InitStream(StreamProviderOptions options)
{
WebProxy proxy = new WebProxy(proxyUrl);
WebRequest request = WebRequest.Create(options.DefaultPath);
request.Proxy = proxy;
WebResponse response = request.GetResponse();
options.Stream = response.GetResponseStream();
}
void IStreamProvider.CloseStream(StreamProviderOptions options)
{
if (options != null && options.Stream != null)
{
options.Stream.Close();
}
}
}
Can you try it and let us know your feedback.