PUT vs. POST for Uploading Files – RESTful API to be Built Using Zend Framework

There seems to be quite a bit of misunderstanding here. PUT versus POST is not really about replace versus create, but rather about idempotency and resource naming. PUT is an idempotent operation. With it, you give the name of a resource and an entity to place as that resource’s content (possibly with server-generated additions). Crucially, … Read more

How to upload file using Selenium WebDriver in Java

First make sure that the input element is visible As stated by Mark Collin in the discussion here: Don’t click on the browse button, it will trigger an OS level dialogue box and effectively stop your test dead. Instead you can use: driver.findElement(By.id(“myUploadElement”)).sendKeys(“<absolutePathToMyFile>”); myUploadElement is the id of that element (button in this case) and … Read more

PHP image upload security check list

Re-process the image using GD (or Imagick) and save the processed image. All others are just fun boring for hackers. Edit: And as rr pointed out, use move_uploaded_file() for any upload. Late Edit: By the way, you’d want to be very restrictive about your upload folder. Those places are one of the dark corners where … Read more

How to find when a web page was last updated

No, you cannot know when a page was last updated or last changed or uploaded to a server (which might, depending on interpretation, be three different things) just by accessing the page. A server may, and should (according to the HTTP 1.1 protocol), send a Last-Modified header, which you can find out in several ways, … Read more

Upload Progress Bar in PHP

This is by far (after hours of googling and trying scripts) the simplest to set up and nicest uploader I’ve found https://github.com/FineUploader/fine-uploader It doesn’t require APC or any other external PHP libraries, I can get file progress feedback on a shared host, and it claims to support html5 drag and drop (personally untested) and multiple … Read more

How to limit the number of dropzone.js files uploaded?

I achieved this a slightly different way. I just remove the old dropped file any time a new file is added. It acts as overwriting the file which was the user experience I was going for here. Dropzone.options.myAwesomeDropzone = { accept: function(file, done) { console.log(“uploaded”); done(); }, init: function() { this.on(“addedfile”, function() { if (this.files[1]!=null){ … Read more