File name changed in web client - .doc extension added

Hello,

I want to save a file from my servoy web client. It normally works well. But it happened some times, also on Mac and PC, that at the end of the file name, a “.doc” suffix is added.

The binaryData field is an XLS generated by a plugin

This is what I’m doing in my code:

application.output("fileName: " + fileName);		

// Download file to client
plugins.file.writeFile(fileName, binaryData);

The console output with the file name is:

fileName: my file.xls

But the file is downloaded on my pc with this name: my file.xls.doc
You can see in the attached image the downloaded file from Chrome.

Who add that .doc extension?

Greetings,
Bogdan.

xls.doc.png

which browser?

maybe you encounter the content type bug, that XLS are seen as msword files and then the browser adds that extension.

you could try to use writeFile with the 3th argument whee you specify the right mimetype, i think “application/vnd.ms-excel”

Yes, that’s was it.

Thanks a lot.

Is there a way of downloading multiple files in one go from the webclient?
I have a selected foundset with blobs in the database, but i don’t want the user to
manually click through a download dialog for each record.

Thanks,
Maarten.

can’t you merge it (zip it) and then download as one go?

No they have to remain seperate pdf’s

then as far as i see you have to create X number of download links
You can’t do that in the webclient in one go.

We had a similar thing, we have choosen, to give the client two options

  1. one pdf (merged) directly in webclient
  2. one mail, with all seperate pdf’s

And I must say, working great! :-)

Thanks for the tip Harjo.
I was also considering email as an alternative.

Is there a way to zip the files?
Email is not a good alternative bcause of spamfilter blocks etc…

yes, the it2be tools plugin, can do that!