This file's format is not supported or you don't specify a correct format

i’m passing sharepoint file url of type .docx with credentials for authentication but it shows me error for format not supported.


For reference i’m sharing stack trace with you. It seems that it interpret this file as excel workbook.

Interesting thing is that when the same file i tried to open from local location after download it. Viewer works totally fine



Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: Aspose.Cells.CellsException: This file’s format is not supported or you don’t specify a correct format.

Stack Trace:

[CellsException: This file’s format is not supported or you don’t specify a correct format.]
”.‡.() +184
”.‡.Read() +15
”.†.(Workbook , LoadOptions ) +122
Aspose.Cells.Workbook.Ÿ(Stream , LoadOptions , Boolean ) +2408
Aspose.Cells.Workbook…ctor(Stream stream, LoadOptions loadOptions) +127
..(Stream content) +131

[: Unable to open the document.]
Groupdocs.Web.UI.Handlers.BaseHandler.OnException(Exception exception, HttpContext context) +635
Groupdocs.Web.UI.Handlers.ViewDocumentHandler.ProcessRequest(HttpContext context) +3523
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +341
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +69

Hello,


We are sorry to hear that you have such issue. First and most important thing that you should know is that that the SharePoint store all documents in the DB and since that you can’t view document via URL. To view the file you have two possible ways:

1. Store document locally as you did
2. Get document stream from URL and then use this stream in the Viewer as described here

In case that you need more help please share with us document URL if it accessible from the internet and Viewer widget code.

Thank you.

Thanks for your great advise. Yes both ways will work for this scenario. But for now i used your 2nd advise.


Thanks for the support.


Hello,


Glad to hear that my advice was useful for you.

Best regards.

In fact my issue is resolved but one thing is little strange for me. When i give some other file type url of sharepoint file to your library like Excel or Txt file. It works fine, when i open docx file with it, it gives me file not supported error.


Can you give above exception detail to your developers? So that they may check against it. As exception shows that your library recognize .docx file as an Excel file. Which could be the cause of that problem.

Looking forward for your response!



Hello,


Thank you for your request. Our library works well with all supported file types. The reason of your issue is in the SharePoint inner processes, how it stores different file types and how it works with them.

Also in case using stream in the Viewer, the .Stream option have very important parameter “string fileExtension” it should be set to correct and appropriate file extension for current file.

Best regards.

Yes i know the list of supported file types, but i’m telling you what i experienced.


if there is a Sharepoint issue then it shouldn’t open any file from sharepoint but interesting thing is that it open even [.doc] type as well and fail to open [.docx]

Following are the types which i have tested with overloaded URL method
i.e. Url ( docUrl, username, pwd, domain) and there results are:

Working Types:
.doc
.xlsx
.xls
.txt
.ppt

Not Working Types:
.docx
.pptx


Since its a new feature so I think, it couldn’t support some of the file types. It would be appreciate, if you could help me out of this. We are trying to make it a part of Sharepoint and this product will extensively use in it.

Hello,


Thank you for this info. I will transfer it to our Product team and they will check what we can do with it. When I will have any news for you I will notify you.

Best regards.

Thanks, I’m looking forward for your response. And anxiously waiting for the quick fix.

Hello,


We have provided an investigation for the issue and found out that we can successfully open our docx document. We have tested it under admin account of the SharePoint. Also in the SharePoint Admin we have added internal URL for the intenet access to the SharePoint demo site as shown on these screenshots:
1. Screenshot by Lightshot
2. Screenshot by Lightshot
3. Screenshot by Lightshot

After these configs we were able to open the docx.

Could you please share with us - do you made same steps and if possible your docx file example that we can check it.

Best regards.