Upload file to SFTP using PowerShell

You didn’t tell us what particular problem do you have with the WinSCP, so I can really only repeat what’s in WinSCP documentation. Download WinSCP .NET assembly. The latest package as of now is WinSCP-6.1-Automation.zip; Extract the .zip archive along your script; Use a code like this (based on the official PowerShell upload example): # … Read more

Streaming large file uploads to ASP.NET MVC

It turns out that my initial code was basically correct; the only change required was to change request.ContentLength = clientRequest.InputStream.Length; to request.ContentLength = clientRequest.ContentLength; The former streams in the entire request to determine the content length; the latter merely checks the Content-Length header, which only requires that the headers have been sent in full. This … Read more

Remove selected file(s) before upload with Javascript

FileList has no API to remove entries: https://developer.mozilla.org/en/DOM/FileList However you can reconstruct File uploader using XHR2 and AJAX and filter in content there. This implies doing XHR2 and AJAX upload and is not suitable for traditional <form> uploads. https://developer.mozilla.org/en/Using_files_from_web_applications

Django admin file upload with current model id

I ran into the same problem. Okm’s answer sent me on the right path but it seems to me it is possible to get the same functionality by just overriding the save() method of your Model. def save(self, *args, **kwargs): if self.pk is None: saved_image = self.image self.image = None super(Material, self).save(*args, **kwargs) self.image = … Read more

Ajax file upload

Use a hidden iframe and set your form’s target to that iframe’s name. This way, when the form is submitted, only the iframe will be refreshed. Have an event handler registered for the iframe’s load event to parse the response. More details on my blog post: http://blog.manki.in/2011/08/ajax-fie-upload.html