file-upload

How can I have a preselected input for when type=“file”? [duplicate]

夙愿已清 提交于 2021-01-28 07:39:44
问题 This question already has answers here : How to set file input value when dropping file on page? [duplicate] (1 answer) Putting default value in <input type=file…> (1 answer) Closed 6 years ago . Note: The answers & comments below reflect the state of legacy browsers in 2009. Now you can actually set the value of the file input element dynamically/programatically using JavaScript in 2017. See the answer in this question for details as well as a demo: How to set file input value

google.script.run fails in case of file input

回眸只為那壹抹淺笑 提交于 2021-01-28 05:32:37
问题 I have a google apps script bounded to a spreadsheet, and I created a html form to upload csv and excel files to process them and load the data to the spreadsheet. Everything worked fine in the last 2 years, but since March 2020 the file uploading fails. When I submit the upload form, I got the following message: We're sorry, a server error occurred. Please wait a bit and try again. I checked and the the server-side function is not even called. If I remove the file input field from the form,

File upload in codeigniter using ajax

筅森魡賤 提交于 2021-01-28 05:02:11
问题 I am trying to upload file using ajax in codeigniter framework. My code work without using ajax but when i use ajax i got error message 'Undefined index: picture'in if($_FILES['picture']['name']). Please check this code View : <form enctype="multipart/form-data" method="post"> <div class="form-group"> <label for="int">Picture</label> <input type="file" id="picture" name="picture" class="dropify" data-height="300" /> </div> </form> AJAX : var picture=new FormData( $("#picture")[0] ); var url =

Unable to upload file in s3 bucket using laravel 5.7- Argument 1 passed to League\Flysystem\AwsS3v3\AwsS3Adapter:

强颜欢笑 提交于 2021-01-28 04:58:55
问题 I am trying to upload the image to the s3 bucket but unable to do so. Getting the following error: Storage::disk('s3')->put($filename, file_get_contents($file)); Argument 1 passed to League\Flysystem\AwsS3v3\AwsS3Adapter::__construct() must be an instance of Aws\S3\S3ClientInterface, instance of Aws\S3\S3Client given, called in /var/www/html/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php on line 208 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\

use dropzone.options without form

ε祈祈猫儿з 提交于 2021-01-28 04:05:10
问题 I want to use dropzone on with id. But my Dropzone.options.myid={} is not working. How to validate file type, size in var myDropzone = new Dropzone("div#myid", { url: "/file/post"}); I cant use tag console.log file is not working why? My source: <div id="myid" style="width: 500px; height: 300px; border: 1px solid black">click here</div> javascript var myDropzone = new Dropzone("div#myid", { url: "dropzoneupload"}); Dropzone.options.myid = { paramName: "file", // The name that will be used to

Node.js connection reset on file upload with multer

a 夏天 提交于 2021-01-28 03:26:57
问题 I have a node/express app that handles file uploads with multer. Everything works well on my local machine, but on the server, if the uploaded file exceeds a couple of Mbs, the browser stops with a "connection reset" error. Here is a simple test version of the upload script: var express = require('express'); var multer = require('multer'); // Create server var app = express(); // Start server function startServer() { var port = 8888; server = app.listen(port, function () { console.log('Node

django rest framework doesn't accept blob picture file (File extension “” is not allowed)

允我心安 提交于 2021-01-28 02:15:46
问题 I am trying to update a User Profile by making a multipart/form-data put request (from my vue frontend using axios) containing a png blob image file. I receive an error message: File extension “” is not allowed. This is the File Field on the Userprofile Model: profile_picture = models.FileField( _("Profile Pictures"), upload_to="profile_picture", max_length=100, blank=True, null=True, ) These are the signals I use in the Userprofile model to save and update the Model. @receiver(post_save,

ASP Upload Component - Classic ASP

白昼怎懂夜的黑 提交于 2021-01-27 23:51:41
问题 I have just moved a site from a dedicated server to a GoDaddy shared hosting account, and have just encountered loads of problems! One being with ASP Upload. In Classic ASP, this is what I would normally do to upload files to my folder: Set upload = Server.CreateObject("Persits.Upload") uploadPath = Server.MapPath("../../files/photos/"&token_&"/") upload.IgnoreNoPost = True upload.Save(uploadPath) Set upload = Nothing But since moving to GoDaddy, I get this nasty message: This feature has

In Django, how do I save a file that has been uploaded in memory as an email attachment?

折月煮酒 提交于 2021-01-27 23:41:45
问题 I am building an email gateway for our clients and need to be able to attach the files they upload to the email. I am using EmailMultiAlternatives to send the email and a FileField for the upload. The problem happens when I try to connect the two. I have the following logic in my view. if request.method == 'POST': form = MyForm(request.POST, request.FILES) if form.is_valid(): ... email = EmailMultiAlternatives(...) email.attach(request.FILES['image']) else: form = MyForm() This results in "No

how to merge chunks of file (result of html5 chunking) into one file fast and efficient

喜夏-厌秋 提交于 2021-01-27 18:58:28
问题 I create a file transfer program which upload files (huge file about 4gb) using html5 chunking. each chunk is sized of 100MB (I just choose this for no reason, as I try use 10MB, it does not really have any difference as far as I can tell). It upload correctly each chunk. but at the end of finish uploading, I try to merge the file back into 1 piece, but it takes so much time. If I try to refresh the web ui for the uploader, it won't work until it finish merging. my merge code something like