theLog.printDebugInfo("id: "+cid);
//insert was not successfull
if(cid==null){
+ //How do we know that it was not succesful cause of a
+ //dupe, what if it failed cause of "No space left on device"?
+ //Or is there something I am missing? Wouldn't it be better
+ //to have an explicit dupe check and then insert? I have no
+ //idea what I am talking about. this comment is in case
+ //I forget to explicitely ask. -mh
deliver(req, res, mergeData, postingFormDupeTemplate);
}
for(Iterator it = mp.requestList.iterator(); it.hasNext();){
MpRequest mpReq = (MpRequest)it.next();
String fileName = mpReq.getFilename();
+
//This is just a temporary way to get the content-type via
//the .extension , we need to use a magic method, by looking
- //at the header (first few bytes) of the file. -mh
- //the Oreilly method sucks cause it rely's on the what
+ //at the header (first few bytes) of the file.
+ //the Oreilly method sucks cause it relies on the
//content-type the client browser sends and that's
- //too often application-octet stream.
+ //too often application-octet stream. -mh
String contentType = FileUtil.guessContentTypeFromName(fileName);
HashMap mediaValues = new HashMap();
//The map file should be Mir/content-types.properties, it's the
//default Sun Java file+ some entries that it did not have.
//so if you support a new media type you have to make sure that
- //it is in this file
+ //it is in this file -mh
if ((contentType==null) || (contentType=="application/octet-stream")) {
throw new ServletModuleException("ModuleException: One or more files of unrecognized types");
}
//save and store the media data/metadata
mediaHandler.set(mpReq.getMedia(), mediaEnt,mediaTypesList.elementAt(0));
- //were done with mpReq at this point, dereference it. as it contains
- //mucho mem. -mh 01.10.2001
+ //were done with mpReq at this point, dereference it.
+ //as it contains mucho mem. -mh 01.10.2001
mpReq=null;
if(mediaId!=null){