Author: bombe
Date: 2006-08-05 21:31:00 +0000 (Sat, 05 Aug 2006)
New Revision: 9916

Modified:
   trunk/freenet/src/freenet/clients/http/QueueToadlet.java
Log:
don't try to insert empty files :)

Modified: trunk/freenet/src/freenet/clients/http/QueueToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2006-08-05 
21:24:07 UTC (rev 9915)
+++ trunk/freenet/src/freenet/clients/http/QueueToadlet.java    2006-08-05 
21:31:00 UTC (rev 9916)
@@ -139,8 +139,12 @@
                                writeError("Invalid URI to insert", "You fooled 
around with the POST request. Shame on you.", ctx);
                                return;
                        }
+                       HTTPRequest.File file = 
request.getUploadedFile("filename");
+                       if (file.getFilename().trim().length() == 0) {
+                               writeError("No file selected", "You did not 
select a file to upload.", ctx);
+                               return;
+                       }
                        boolean dontCompress = 
request.getPartAsString("dontCompress", 128).length() > 0;
-                       HTTPRequest.File file = 
request.getUploadedFile("filename");
                        String identifier = file.getFilename() + "-fred-" + 
System.currentTimeMillis();
                        /* copy bucket data */
                        Bucket copiedBucket = 
node.persistentEncryptedTempBucketFactory.makeBucket(file.getData().size());


Reply via email to