Here is my code
It should just create a file, fill a column with a value and return it.
If I test it on localhost, the excel file is correct
But if I deploy it to a vps, the file returned is broken
Any idea what might be wrong?
Here is the curl I am using for the post request:
curl -X POST http://localhost:8080 --output file.xlsx
Your code works fine for me. I’ve deployed the compiled binary at my VPS. You cann access it as https://www.lhorn.de/file.xlsx
Can you share the URL to your VPS?
here is the curl I am using to my vps
curl -X POST http://22.214.171.124:8080 --output file.xlsx
Why do you
POST? Your code works for
What I find strange is that your deployment and my deployment return files that have different file types. Your original code as deployed on my VPS produces a file that is identified as
Microsoft OOXML. But the file returned by your deployment is identified as
Microsoft Excel 2007+.
How did you build the binary you run on your VPS? Did you build it locally and copied it to the VPS? Or did you build it on the VPS using Go there?
as I want to post the data in a json file, and get the output in the excel file
wow, that is strange - will look into it
actually I have not even built it yet- its just go run main.go on my vps at the moment
by the way- is your vps running on linux?
in the end, the only issue I had that on both my VPS-es I had go 1.6.
after updating it to 1.10, it works properly. thank you
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.