I am uploading a file using apache commons fileupload.
I am trying to store the file in a derby blob field.
The file is zipped with a pdf file as a zip entry.
After uploading the file, then I test the file by downloading it and the
downloaded file gives me errors.
To test what the problem is, I saved the uploaded file in a temp location
using the same methods as loading the blob, and the temp file works find.
Here is a code example:
...
byte[] data = item.
...
SerialBlob sb = new SerialBlob(data);
...
PreparedStatement ps = connection.prepareStatment("insert into
my_file(file_name, the_file) values(?,?)");
ps.setString(1,file_name);
ps.setBlob(2,sb);
ps.execute();
--
View this message in context:
http://www.nabble.com/Derby-Blob-tp19203507p19203507.html
Sent from the Apache Derby Users mailing list archive at Nabble.com.