Questions tagged [upload]

Upload refers to the sending of data from a local system to a remote system such as a server or another client with the intent that the remote system should store a copy of the data being transferred, or the initiation of such a process

Upload refers to the sending of data from a local system to a remote system such as a server or another client with the intent that the remote system should store a copy of the data being transferred, or the initiation of such a process.

Use if you having trouble to upload data of files with fixed file sizes. But for continuous transmission use tags with stream like or the library specific tags like , , etc.

Important Hint

In web development, there is a common mistake beginners often make during coding forms for uploading files. This mistake is not supplying the enctype attribute in the form tag, or supplying it in a form's element instead of supplying it in the form tag itself. To ensure that the form is going to submit files the form tag should be something like the following:

<form method="post" action="some/server/side" enctype="multipart/form-data">
... The form's elements...
</form> 
14140 questions
160
votes
10 answers

HTML: How to limit file upload to be only images?

With HTML, how do I limit what kind of filetypes can be uploaded? To easy the user experience, I want to limit file uploads to be only images (jpeg, gif, png).
JacobT
  • 3,021
  • 4
  • 22
  • 12
138
votes
19 answers

Uploading multiple files using formData()

var fd = new FormData(); fd.append("fileToUpload", document.getElementById('fileToUpload').files[0]); var xhr = new XMLHttpRequest(); xhr.open("POST", "uph.php"); xhr.send(fd); uph.php: var_dump($_FILES['fileToUpload']); This works, but obviously…
jaanisk
  • 1,381
  • 2
  • 9
  • 4
135
votes
8 answers

Html helper for

Is there a HTMLHelper for file upload? Specifically, I am looking for a replace of using ASP.NET MVC HTMLHelper. Or, If I use using (Html.BeginForm()) What is the HTML control for the file upload?
Graviton
  • 81,782
  • 146
  • 424
  • 602
126
votes
5 answers

Show an image preview before upload

In my HTML form I have input filed with type file for example : Then I'm selecting multiple files by clicking that input button. Now I want to show preview of selected images before submitting form . How to do that…
Hardik Sondagar
  • 4,347
  • 3
  • 28
  • 48
124
votes
8 answers

Save image from URL by paperclip

Please suggest me a way to save an image from an URL by Paperclip.
khanh
  • 4,516
  • 10
  • 29
  • 48
122
votes
13 answers

"The given path's format is not supported."

I have the following code in my web service: string str_uploadpath = Server.MapPath("/UploadBucket/Raw/"); FileStream objfilestream = new FileStream(str_uploadpath + fileName, FileMode.Create, FileAccess.ReadWrite); Can someone help…
All Blond
  • 1,243
  • 2
  • 8
  • 4
111
votes
30 answers

CFBundleVersion in the Info.plist Upload Error

"The binary you uploaded was invalid. The key CFBundleVersion in the Info.plist file must contain a higher version than that of the previously uploaded version." I’m getting this error when I come to upload my application. I set the updated…
Adam H
  • 1,521
  • 2
  • 16
  • 19
111
votes
7 answers

How do I test a file upload in rails?

I have a controller which is responsible for accepting JSON files and then processing the JSON files to do some user maintenance for our application. In user testing the file upload and processing works, but of course I would like to automate the…
animal
  • 3,179
  • 3
  • 21
  • 17
109
votes
7 answers

Python Script Uploading files via FTP

I would like to make a script to upload a file to FTP. How would the login system work? I'm looking for something like this: ftp.login=(mylogin) ftp.pass=(mypass) And any other sign in credentials.
Frustrated Python Coder
  • 1,503
  • 3
  • 15
  • 15
100
votes
11 answers

Changing upload_max_filesize on PHP

I'm using PHP 5.3.0 and have encountered something that might be a bug (in which case I'll report it) or might be me - so I'm asking to make sure. When running this code:
Ross
  • 46,186
  • 39
  • 120
  • 173
99
votes
9 answers

Uploading Files in ASP.net without using the FileUpload server control

How can I get an ASP.net web form (v3.5) to post a file using a plain old ? I am not interested in using the ASP.net FileUpload server control.
Ronnie Overby
  • 45,287
  • 73
  • 267
  • 346
98
votes
2 answers

how to upload file using curl with PHP

How can I upload a file, either by using cURL or anything else, in PHP? In other words, the user sees a file upload button on a form, the form gets posted to my PHO script, then my PHP script needs to re-post it to another script (eg on another…
Hadidi44
  • 1,007
  • 2
  • 9
  • 7
96
votes
7 answers

How to gracefully handle files that exceed PHP's `post_max_size`?

I'm working on a PHP form that attaches a file to an email, and trying to gracefully handle cases where the uploaded file is too large. I've learned that there are two settings in php.ini that affect the maxiumum size of a file upload:…
Nathan Long
  • 122,748
  • 97
  • 336
  • 451
95
votes
11 answers

How to reduce an Image file size before uploading to a server

Lot of application allow sharing an image, which is picked from the gallery. Do they upload the original image file? Which is like 1-3 mb? Or do they process? In any case, how can I take the image from a filepath, reduce its size by lowering the…
user1537779
  • 2,311
  • 5
  • 28
  • 45
89
votes
3 answers

fileReader.readAsBinaryString to upload files

Trying to use fileReader.readAsBinaryString to upload a PNG file to the server via AJAX, stripped down code (fileObject is the object containing info on my file); var fileReader = new FileReader(); fileReader.onload = function(e) { var…
Blank
  • 4,635
  • 5
  • 33
  • 53