I am m having an issue uploading an Excel file to a web application. It shows "Bad or Invalid file". However, if I re-save the same file without making any changes and upload it again, it works. What could be the root cause and solution?
I'm not sure I'm totally following your question, but I think I'd start by playing around with the Field Types by using a select tool. Excel, for example, is Microsoft so using DOUBLE for numbers, DATE for dates, and a simple V_STRING for text might do the trick. That said, there are reasons to use the other Field Types too! Not saying this will solve it for you, but it's worth a shot to open up the ideas.
Curious to hear from others, but this is what I would attempt first.
To second @jrlindem, try using the Auto Field Tool to make the field types smaller.
https://help.alteryx.com/current/en/designer/tools/preparation/auto-field-tool.html
Re-saving in Microsoft Excel rewrites the file using Excel’s standardised Open XML engine, which:
A solution I can think of is perhaps by adding a run command tool to just resave the Excel file or a Python script to recheck and resave it with the factor mentioned above.
What does this have to do with Alteryx?
@apathetichell the going assumption is that the Alteryx Workflow is generating the output and that it may be responsible for formatting the output file in a way that's causing the "bad or invalid" file state. If that's the case, the suggestions are geared towards helping resolve that, if the workflow is the culprit.
@jrlindem stick around here long enough and you'll start asking these questions.
@jrlindem btw --- my hypothesis is that this is related to the excel trust center --- and not an Alteryx issue at all. or user is creating the wrong type of file (xls vs xlsx/vice versa) for their input system.
One thing that could seem Alteryx related, is how the sheet name is quoted on the Output Tool.
A couple years ago when the drivers changed, the need to have |||'SheetName$' changed, and then earlier this year I noticed that sometimes when excel files were written out like that, the $ would try to be in the sheet name and cause Excel to have to "fix" the file. I don't know the correct format to say, but worthwhile checking that.
If this file is created by Alteryx, then you need to check whether the file is created correctly or not, incorrectly defining Sheet Name normally causes excel to corrupt.
If you are looking for a solution for an excel that is not generated by Alteryx, then still opening the excel and saving it will be the best approach, as nothing can fix excel better than the excel itself.
User | Count |
---|---|
52 | |
27 | |
25 | |
24 | |
21 |