upload

How to add text input to dropzone upload

天涯浪子 提交于 2019-11-30 12:01:37
问题 I'd like to allow users to submit a title for each file that is dragged into Dropzone that will be inputted into a text input. But i don't know how to add it. Everyone can help me? This is my html code code <form id="my-awesome-dropzone" class="dropzone"> <div class="dropzone-previews"></div> <!-- this is were the previews should be shown. --> <!-- Now setup your input fields --> <input type="email" name="username" id="username" /> <input type="password" name="password" id="password" />

Uploading big files over HTTP

半世苍凉 提交于 2019-11-30 11:36:05
问题 I need to upload potentially big (as in, 10's to 100's of megabytes) files from a desktop application to a server. The server code is written in PHP, the desktop application in C++/MFC. I want to be able to resume file uploads when the upload fails halfway through because this software will be used over unreliable connections. What are my options? I've found a number of HTTP upload components for C++, such as http://www.chilkatsoft.com/refdoc/vcCkUploadRef.html which looks excellent, but it

Unit Test a file upload, how?

我只是一个虾纸丫 提交于 2019-11-30 11:28:38
Using MVC3.NET I have a file upload method in a controller that works fine with the following signature public ActionResult UploadFile(IEnumerable<HttpPostedFileBase> file) How can I unit test this with NUnit? I have looked around and everyone seems to point to Moq but I'm new to unit testing and cannot get Moq working. I have found interesting blogs such as this: http://danielglyde.blogspot.com/2011/07/tdd-with-aspnet-mvc-3-moq-and.html but am struggling to figure out how the same might be done to 'fake' a file upload, and am also wary that a lot on moq examples that I have managed to find

Uploading IOS app to app store. Seems to freeze and internet stop working

限于喜欢 提交于 2019-11-30 11:28:30
In Xcode i have have created an archive of the app. Verified it no problem. then when i click Distribute i get as far as "Your application is being uploaded" and shows the progress bar. The bar never moves and after a few minutes my internet breaks. i need to restart my router to get the internet back. one of the times i received this error "SSL error occured and a secure connection to the server cannot be made" Anyone ever experienced this or have an idea of whats happening? Thanks I also faced this problem: " your application is being uploaded stuck " My ANSWER IS: Either just delete your

Node.js, multer and req.body empty

大兔子大兔子 提交于 2019-11-30 11:23:02
Here it is my problem, I have a form where I can insert a file and a field but I receive only the file and not the parameter test ! Why? This is my code: app.js: var express = require('express'); var bodyParser = require('body-parser'); var app = express(); var port = 8000; var multer = require('multer'); // v1.0.5 var storage = multer.diskStorage({ destination: function (req, file, callback) { callback(null, './uploads'); }, filename: function (req, file, callback) { callback(null, file.originalname.substring(0,file.originalname.lastIndexOf('.')) + '-' + Date.now() + file.originalname

Best method to generate unique filenames when uploading files PHP [duplicate]

北慕城南 提交于 2019-11-30 11:08:55
This question already has an answer here: Unique and temporary file names in PHP? 9 answers Can any one suggest the best practice to generate unique file names for file uploads to avoid duplicate Entries? Thanks In Advance. I usually either create a UID using uniqid() function for the filename or create a folder with the name of the username who is uploading the file and leave the original filename. The disadvantage of the first one is that you will have to save the original filename somewhere to show to the user. This function may help: http://php.net/manual/en/function.uniqid.php You may

Carrierwave, Rails 4, and Multiple Uploads

蓝咒 提交于 2019-11-30 10:52:03
问题 I have been banging my head against the wall trying to get Carrierwave, Rails 4, and Multiple Uploads all working together. I can get a single file upload working just fine as in this and many other projects. This is not a nested situation - just simply uploading to a single model called Transcription and wanting to create a record for each document uploaded. I cannot seem to find the correct way to declare the "document" field used for the carrierwave mount mount_uploader :document,

JSP Uploading and downloading Video

瘦欲@ 提交于 2019-11-30 10:46:51
I want to design a website that allows an admin to download and upload video. Can anyone guide me how to do it? Is it same as upload and download image? Any site have example? BalusC Uploading can be done the same way. You basically just need to end up with an InputStream in the server side which you then write to any OutputStream you want, e.g. FileOutputStream to store it at local disk file system. Downloading is basically also the same way, you only need to change the Content-Type header accordingly to represent the correct content type so that the browser knows what to do with it.

Twitter API -> updating profile bg image with php

梦想与她 提交于 2019-11-30 10:32:25
So far I have been trying to update the twitter profile bg image thr the twitter api with php... and without success Many examples on the web, including this one: Updating Twitter background via API and this one Twitter background upload with API and multi form data do not work at all, most ppl throw out answers without actually testing the code. I found that directly submit the image to the twitter.com thr html form, it will work: <form action="http://twitter.com/account/update_profile_background_image.xml" enctype="multipart/form-data" method="post"> File: <input type="file" name="image" />

XMLHttpRequest Level 2 - Determinate if upload finished

萝らか妹 提交于 2019-11-30 10:26:44
问题 I am using ajax for file uploads. After the file is uploaded, php should check it (mime, size, virus (clamscan) and more) - this takes some seconds for larger files. While the file is uploading, a HTML5 <progress> is filling, when the file is ready and PHP starts checking, the progress should switch to indeterminate. I thought of to ways to do this (which both do not work): Checking upload.onload event xhr.upload.addEventListener("load", function (e) { $("#uploadprogress").attr("value", false