java - FileWriter() corrupt file warning -
i have app converts jtable instances excel file. in previous question, had problem in using fileoutputstream() , turns out problem lies within ad user's privilege in accessing folders/files. since superior wont allow me change privileges, resorted using filewriter() instead, worked well. problem kept on warning users file opening corrupt. here's warning:
the file trying open, 'filename.xls' in different format specified file extension. verify file not corrupted , trusted source before opening file. want open file now?
i searched solution resides in excel 2007's file extension security. info can found here
i made configuration in system registry of every workstation app covers.
i want ask if there's away remove corrupt file warning in office 14, because 1 of workstation, superior's workstation, has office 14. changes in system registry didnt stop corrupt file warning in workstation.
i impression indulging in "voodoo programming" practices; i.e. applying solutions don't understand problems don't understand.
firstly, this:
i had problem in using fileoutputstream() , turns out problem lies within ad user's privilege in accessing folders/files. since superior wont allow me change privileges, resorted using filewriter() instead, worked well.
frankly, doesn't make sense. if cannot open file using new fileoutputstream(file), shouldn't able open new filewriter(file). why? because source code constructor this:
public filewriter(file file) throws ioexception { super(new fileoutputstream(file)); } in other words, first thing filewriter constructor call fileoutputstream constructor doesn't work!! (and same applies other overloads of these constructors.)
then current problem excel not letting open xls file because filetype doesn't match suffix. , proposed solution mess around registry. surely, correct approach find out why file type doesn't match suffix.
- have made mistake in file format (e.g. 'cos wrote using filewriter)?
- have chosen wrong file suffix spreadsheet format you've used?
- are downloading user's machine wrong mimetype?
banging on registry on of client machines ... because read in website ... that's voodooo!
i'm not surprised boss forbade mess around ad privileges. @ point, he's worried you'll serious damage.
by way, registry hacking make warning go away turning off security check designed harden user's pc against attack. doesn't strike me sound solution problem.
Comments
Post a Comment