Hi, I've encountered a problem with initial testing of a vanilla DSpace v5.2 install in the following environment:
JSPUI Debian 8 OpenJDK 7U79 Maven 3.0.5 Ant 1.9.4 PostgreSQL 9.4 Tomcat 8.0.14 This appears to be the same problem reported by Donald I Macdonald a couple of months ago: http://dspace.2283337.n4.nabble.com/quot-integrity-quot-error-on-file-uploads-td4676521.html - when trying to complete the upload file step, if I add a description, the upload "fails" with the error: System Error: Malformed Request - and the logs show an "integrity_error" (exactly as reported by Donald). Donald subsequently posted the following: > Replying to myself in case anyone else should find this helpful: > I traced the problem to a section in > org/dspace/submit/step/UploadStep.java > that has to do with the file description string. > As far as I could tell, the program was trying to add a file description > string to a null bitstream. > Not sure why, since the file was uploading perfectly and I was just using > the default “traditional” > form upload. But I suppose I must have done something to cause this to > happen only to my > install… Perhaps it was set up for multi-file upload (not deliberately) > but I was using it for single > uploads? Maybe someone on here can shed some light on that aspect. > But anyway the system was uploading the file in one step, then doing a > separate step to assign > the file description — but second time round the bitstream was null. Hence > the error. > I’m not recommending my fix as the solution for this. In fact, I’m sure > there must be something a lot > simpler you can tweak. But just in case > anyone else is interested I changed the UploadStep.java file > from > 262 // ------------------------------------------------- > 263 // Step #3: Check for a change in file description > 264 // ------------------------------------------------- > 265 String fileDescription = request.getParameter("description"); > 266 if (fileDescription != null && fileDescription.length() > 0) > 267 { > 268 // save this file description > 269 int status = processSaveFileDescription(context, request, > response, > 270 subInfo); > 271 > 272 > 273 // if error occurred, return immediately > 274 if (status != STATUS_COMPLETE) > 375 { > 376 return status; > 377 } > 378 } > 379 > to > 262 // ------------------------------------------------- > 263 // Step #3: Check for a change in file description > 264 // ------------------------------------------------- > 265 String fileDescription = request.getParameter("description"); > 266 if (fileDescription != null && fileDescription.length() > 0) > 267 { > 268 > 269 // --------------------------------------------- > 270 // Every time I tried adding an item to a collection > 271 // I would get an error message about Malformed item > 272 // Traced this to this method - file upload happens > 273 // but then this method gets called to set the description > 274 // and the bitstream the /second/ time round is null. > 275 // So we get the bitstream from the Item object and > 276 // set the description string on that. Not sure if that > 277 // is the right thing to do but it seems to work... > 278 // D I Macdonald 2015-02-06 > 279 // ---------------------------------------------- > 280 if (subInfo.getBitstream() == null) > 281 { > 282 if (item != null) > 283 { > 284 Bundle[] bundle = item.getBundles("ORIGINAL"); > 285 if (bundle.length!=0) > 286 { > 287 Bitstream[] bitstreams = > bundle[0].getBitstreams(); > 288 if (bitstreams[0] !=null) > subInfo.setBitstream(bitstreams[0]); > 289 } > 290 } > 291 } // - - end of DI insert > 292 > 293 // save this file description > 294 int status = processSaveFileDescription(context, request, > response, > 295 subInfo); > 296 > 297 > 298 // if error occurred, return immediately > 299 if (status != STATUS_COMPLETE) > 300 { > 301 return status; > 302 } > 303 } > 304 - so I tried this but it seems that it is only partially successful. It works in the case of a single file plus description (no longer get the error and the submission completes successfully) - but if I try and add multiple files (either by reclicking "Upload File" option in the "drag and drop" space or by using "Add another file" option on the next screen), any description added simply overwrites the description of the first file (which, reading the code above makes sense!) . . . I've had a little poke about in JIRA but couldn't find anything recent that looked like it related to this (but happy to be corrected!). Has anyone else come across this issue (of submissions failing if a File Description is added)? Anyone have, or know of, a fix for it (before I start blindly trying to hack this bit of code myself!)? Any insights or pointers welcome! I know that the repository I'm currently trying to build will have submissions with multiple files that all have descriptions, so I really need to get this working :-) Thanks as ever, Mike Michael White eLearning Developer Information Services T: (01786) 466877 E: michael.wh...@stir.ac.uk A: S8, Library, University of Stirling, Stirling, FK9 4LA -- View this message in context: http://dspace.2283337.n4.nabble.com/integrity-error-on-file-uploads-tp4676521p4678122.html Sent from the DSpace - Tech mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ DSpace-tech mailing list DSpace-tech@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dspace-tech List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette