Click here to Skip to main content
15,891,905 members
Everything / File Upload

File Upload

File-Upload

Great Reads

by Timothy Svecz
Amazon AWS: Setting up FTP on EC2 Windows Instances
by Amogh Natu
This tip discusses the method to allow the uploading of large size files in ASP.NET
by ASP.NET Community
In my case, I use  a FileUpload Control(Id:->FileUpload1), an ImageButton(ImageButton1) or you can use the Image,  a Button Control(Id:->Updatebttn)
by SwarnenduDas
How to fetch an image document from FileNet for a known Document ID

Latest Articles

by Member 13353000
How to upload images on MVC Web App razor pages using ASP.NET Core 2.2
by Yahya Mohammed Ammouri
This article describes how to add a fully client side Multiple File Upload functionality to your page. Include select multiple files at a time, Select from different folders, Apply validation, show files in thumbnails and remove files from the list.
by girishmeena
All the information regarding Ajax file upload control and validation
by Bjørn
A simple explorer and file transfer for files over a telnet connection

All Articles

Sort by Updated

File Upload 

14 Feb 2024 by Hailu Worku Obsse
Your approach seems correct for saving a file to a shared folder on a network computer using ASP.NET. However, there are a couple of adjustments that you might need to make: UNC Path Format: The UNC (Universal Naming Convention) path should be...
29 May 2022 by Member 15627495
Hello ! you have HTML errors : don't use native keywords as 'name' or 'id', see in your code : name="submit" name="img" keep 'img' and 'submit' at their place, it's HTML keywords. the DOM of the page is a lazy ( fast/multi-purposes ) engine,...
29 May 2022 by Member 15654996
hello I using this code in my other table and it work fine but when I use it on product table will not add new product before I did the code I used XAMPP to insert data but now created a form the same as the other table and I want to make a...
5 Feb 2022 by Member 15524347
here is the code i hope this is enough information because there is not much to tell
5 Feb 2022 by Luc Pattyn
$target_file is an unknown variable inside function upload() unless you declare it "global". :)
24 Aug 2021 by massimopiedimonte99
For some reason I am not able to override Tomcat's settings about the file size limit when working with the UAT profile environment (everything works smoothly on SIT) I am using Spring Boot 2.2 and i am adding these properties to the...
10 Jul 2021 by Jerrell77
Hello, i have problems with validating the file upload types. The rest are working fine but i have no idea how to validate the file types.Below is the part where i validate my file types: private void StartUpLoad() { string companyID = this.Label1.Text; string...
13 May 2021 by dilzz
Dear Experts, I am Doing an ASP.net project. In that project am using Ajax JSON to transfer the datas.And am Using Javascript to read the datas from controls.But I am facing a Problem,I didn't get the Original File path when i used the file Input HTML Control...In Chrome i...
17 Mar 2021 by kyclk11
I have this upload files button in my Angular app. So far my progress bar works fine but it just shows the loading bar while the file is uploading. So how do I add features to show the status of the upload % completed, also display the upload...
11 Feb 2021 by Mohandas_Kulasekaran
I am a ASP.NET developer and at present I work with C# and SQL Server.I would like to have an automated process which does the following:-[1] Connect to SQL Server[2] Select FTP data (host, username and password) and "time to pull data" from a table[3] Based on the "time to pull data"...
11 Feb 2021 by Cool Smith
read this Jon Galloway - //TODONT: Use a Windows Service just to run a scheduled process[^] for some insight
20 Oct 2020 by Darshan j
I am working on the demo project for File Upload mechanism in ASP.Net c#.I tested that demo on my local machine and it is working fine for file with 520 kb file size. But when I try to upload file with 19.20 mb file size, it gives an following error:Server Error in '/'...
13 Aug 2020 by Tridib Chatterjee
I'm trying to upload multiple files in my Angular Application using ngx-material-file-input since my form is made with angular material and it doesn't support input type file by default. I'm using reactive forms but for some reason, the files are...
13 Aug 2020 by Tridib Chatterjee
public onSelectedFileMultiple(event) { if (event.target.files.length > 0) { for (let i = 0; i
19 Nov 2019 by Justice taylor
I am trying to build a project with product information with image. I have tried some code given below, but I can not upload image path in the database. I am a newbie trying to learn code. What I have tried: Controller code:-class Category extends CI_Controller{ public function...
9 May 2019 by Member 13353000
How to upload images on MVC Web App razor pages using ASP.NET Core 2.2
9 Apr 2019 by Abhishek Gupta 18
I am using IONIC version 1 with cordova. I have tried many cordova plugins to browse the PDF files from mobile file system. But None of them has worked for me. Thanks in advance. What I have tried: File Picker, Cordova File Chooser, Cordova-plugin-file
27 Sep 2018 by Member 12710902
[this logic is wrong in this condition always true if i select .png image this is not .jpg then it will give error] it should be !!! if (ext == ".jpg" || ext == ".png" || ext == ".gif" || ext ==".jpeg") { FileUpload1.SaveAs(Server.MapPath(imgPath)); ...
21 Sep 2018 by Pradeep Kumar
Hi all i have been trying to post files for a third party tool through rest api with MultipartFormDataContent. Even though i am writing files to MultipartFordatacontent in byte arry i am receiving error saying "400 bad request no filedata section found in multipart post request". Request: ...
22 Feb 2018 by Er.D.K.Malhotra
I want simply a link, which on click open folder from your computer and ask to choose an image for your profile.it seens as like in Facebook profile picture.Please, if any body know something then plz upload
27 Nov 2017 by Member 11558968
we use request() and superagent() method for uploading files from node js to server via url, it cannot upload the file and shows below error, the following code superagent method is: request.post('/upload') .attach('image', path.join(__dirname +'/new.txt') ).end(function(err,...
27 Nov 2017 by Member 13448860
$("#profileImage").click(funct...
11 Oct 2017 by Yahya Mohammed Ammouri
This article describes how to add a fully client side Multiple File Upload functionality to your page. Include select multiple files at a time, Select from different folders, Apply validation, show files in thumbnails and remove files from the list.
25 Sep 2017 by girishmeena
All the information regarding Ajax file upload control and validation
13 Aug 2017 by OriginalGriff
It's denied because the remote computer doesn't set permissions allowing you (the user on the webserver, which is probably an IIS login rather than a "real" user) to write files to that folder. Check the permissions on the folder, or if you are doing this often, connect a drive letter to the...
13 Aug 2017 by Member 10611055
Access to the path //172.20.2.50/sharedfolder/ is denied. whereas, 172.20.2.50 is the IP of the other PC that is in same network, where i want to store my File.... Plz help me ... What I have tried: protected void btnUpload_Click(object sender, EventArgs e) { if...
19 Mar 2017 by H.AL
I made a complete javascript function using jquery and ajax to upload files ... Everything is working perfectly untill I realized that for some files the error function is fired in ajax instead of success function. Below is my code:$.ajax({ url: 'MyService.asmx/UploadFiles', ...
19 Mar 2017 by H.AL
I found it: I have just added this block in my web.config file The problem was when file size is nearest 5MB, then the request fails
1 Mar 2017 by dell-gl62m
I am trying to store images to database which is moving the image to temporary file first then only save the image name to mysql database. I am able to upload image but some of image which size is > 2MB unable to move to temporary files. I am not sure either it is because of granting permissions...
1 Mar 2017 by Peter Leow
Most likely it is constrained by these default settings in the php.ini file:upload_max_filesize[^]andpost_max_size[^]
1 Mar 2017 by Jochen Arndt
You should check for file upload errors before trying to move the file. See PHP: Error Messages Explained - Manual[^].
20 Feb 2017 by Andy Lanng
Hi,This seems like it should work no problem, yet it just doesn't.So I'm using a very funky file / image upload provider GitHub - danialfarid/ng-file-upload: Lightweight Angular directive to upload files with optional FileAPI shim for cross browser support[^]I am going to use this...
14 Apr 2016 by Darshan j
Add following lines of code in your web.config. if you are running on IIS 7 or later add following lines.
13 Apr 2016 by Member 12003400
Follow instructions given here.IIS File Upload Size Limits[^]
12 Mar 2016 by arslan afzal bhatti
i am using HTTP post function to upload multiple files but when i select more than 4 files then after uploading the files are duplicated and repeated in uploaded folder for example if i select 9 files then it will appear 32 files or some time 18 files how can i solve it any person who can help...
2 Mar 2016 by anurag9179
Hi,I am working on desktop application on .net 4.5 Framework, WPF and c#. I have windows 8 machine. I am trying to upload my local file in network path, for this i am using file.copy() but when I am trying to executing it shows "The network name cannot be found." Exception.Code is as...
2 Mar 2016 by Dave Kreskowiak
You're using UNC paths for both file specifications. A proper UNC path is "\\server\shareName\folder\file.ext".The "localpath" should not be a UNC path as I doubt the first "folder" in your path is a valid Share. Workstations don't normally have Shares setup, except for the default...
25 Sep 2015 by OriginalGriff
Or...you could just use Image.GetThumbnailImage[^] - the callback just needs to return false as it's not called any longer.
25 Sep 2015 by djnilo
I have a entry form gift requests the user must enter a photograph in the FileUpload1 up imagethis my code to record the image works Dim data As New vsolicitud Insert Dim As New Fsolicitud 'Assign the image Then if FileUpload1.HasFile ...
24 Sep 2015 by George Jonsson
You cannot compare the whole file name with an extension, test.jpg will never be equal to .jpg.So you need to make your own compare object, where you take that into consideration.See my small example below.You need to create your own class that inherits from IEqualityComparer and...
24 Sep 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
If you have codes below to some line, then that would execute for sure.If you don't want to execute the below code, then you need to return or design your event in that way, where that line would be the last line of code.
24 Sep 2015 by Member 10690878
Hithe below code of button i am facing a problem with it, as it suppose to check if all files has file and then check all uploadfile extension with .jpg or .png if yes then complete the rest of the code var files = new[] { LogoFileExtention, BizImg1FileExtention, BizImg2FileExtention,...
24 Sep 2015 by djnilo
good afternoonasp.net vbmysql lords programmers can be oriented by faI have a entry form gift requests the user must enter a photograph in the FileUpload1 up imagethis my code to record the image worksDim data As New vsolicitud Insert Dim As New Fsolicitud ...
16 Sep 2015 by Manas_Kumar
I believe that you have multiple Upload controls in your page(ditImgFUP,EditPersInfologoFileUp, EditPesInfoBizImg1FU). But in code you are checking hasFile property for one control and SaveAs() for other control. See in below code it is checking file in EditPersInfologoFileUp control but it is...
15 Sep 2015 by Member 10690878
HelloThe below code is working but the problem is that when the images uploaded to the files then it comes empty i mean if i open the folder i see there is image file with correct name but the size is 0 bytes and it did not show the image private string[] GetImagess(string UID) ...
11 Sep 2015 by CPallini
You should post this request in the article's own thread (at the bottom of the article's page).
8 Sep 2015 by Wendelius
Not sure if I understand your question correctly, but instead of if (FileUpload1 != null && FileUpload1.HasFile)tryif (FileUpload1 != null && FileUpload1.HasFile && FileUpload2 != null && FileUpload2.HasFile && FileUpload3 != null && FileUpload3.HasFile && FileUpload4 != null...
8 Sep 2015 by Member 10690878
Hello all In the below code i am looking to check first if all fileuploads has file before process if statement, the below code is checking one FileUpload only. So can you help me with this case please protected void EditAdsUpdateBtn_Click(object sender, EventArgs e) { ...
7 Sep 2015 by Lalyka
Hi guysI have a big problem. I have a class that each time it receives buffer and it should append to a bigger byte array but it do the block copy only the first time, and then it does not copy anythingThis is my code:public Boolean WriteBlobsToDB(byte[] buffer, int offset, int...
3 Sep 2015 by OriginalGriff
If what you are being sent is binary data, then you can;t directly store it in a string, as a string is a collection of characters - and converting binary data to characters rarely means you can convert them back again (as not all character codes are valid depending on the character set being...
3 Sep 2015 by Lalyka
I already Solved my problem the solution is to start slicing the file in fileReader.onload = function (e) { i++; console.log('read chunk nr', currentChunk + 1, 'of', chunks); spark.append(e.target.result); // Append array buffer currentChunk++; if...
3 Sep 2015 by Lalyka
I have this code that will get files on client side and slice the file and send it to server (handler) and there it will append the received slices and append them together and save them in a folder.THIS IS MY QUESTION: what if I want to save the received blobs on server side in a string ? how...
1 Sep 2015 by Sergey Alexandrovich Kryukov
If you use a debugger, you can always stop at the point before the call to the function, not just inside this function. This way, you can see where the control goes instead of the call you need.Also, your bug is probably lexical. JavaScript does not interpret code line by line from the very...
1 Sep 2015 by Lalyka
I am uploading files and I want to calculate md5 for each fileI have written the function calcMD5 that is working well. THE PROBLEM is that when I choose more than one file, it first finish uploading and then it startcalculating the md5. I also have debugged it but it does not even enter the...
30 Aug 2015 by Patrice T
Quote:My problem lies in how I'm going to upload the remaining files since the items in the file element stays immutable....If the list is immutable and you can't update it, may be you can reload it the same way you loaded it on first time.
30 Aug 2015 by edward-l
I'm currently coding a program that handles images and show a preview before upload them, that preview includes the option of deleting some items of the bunch selected. I've look over it and as far as I've been able to read in posts related to this question is "not possible" and the most viable...
19 Aug 2015 by xpertzgurtej
Hello,I have successfully implemented the functionality of displaying image preview of the image being uploaded before actually saving the image by reading the article Show image preview before actually uploading the image in asp.net Its works like charm. But when post back occurs on the...
19 Aug 2015 by Member 11541057
Hi , I am working on MVC5 project , in which we have used Boostrap Modal popup to save the details, and for this we have used common jquery and ajax function which is in one common JS file.My question is how to save image in database using fileupload in Boostrap Modal popup.I am...
13 Aug 2015 by Prince Tegaton
Hi all, am trying to create a custom fileuploader sequence to integrate in my cloud storage project. I want it to look like that of Google Drive.I have submitted the selected files from the fileupload control and able to get all files name but i want to save all files posted to the...
8 Aug 2015 by ParinPatel
if old image delete string imageFilePath = Serve.MapPath(@"~/uploaded/imagefilename.extension");System.IO.File.Delete("imageFilePath");
7 Aug 2015 by Arasappan
Your problem is while the user doesn't choose a image,yours code isif (fileUpload != null && fileUpload.HasFile) { if (fileUpload.PostedFile.ContentType.ToLower().StartsWith("image/")) { ...
7 Aug 2015 by Member 10690878
Hello allThe below code working fine, but i am looking in case if the user did not choose a new photo then the code will not update the current image. The below code when i click on the update button (and keep the file upload empty) it show no image but currently there are an old...
29 Jul 2015 by Member 8787053
I need a popup kind of window which runs minimized where I am uploading large files. The user should be able to interact with other features of the same page which involves postback and even page redirections. The upload window should continue the process (Like gmail attachment or dropbox)...
24 Jul 2015 by krupit
I am trying to upload file in box using box apiits Give me Error is Bad Requestwhats wrong in this code please help mepublic static FileDetails PutFile(string token, byte[] filebytes, string FolderId, string filename, string filecontentType) { Encoding encoding = Encoding.UTF8; ...
19 Jul 2015 by Purushottam Kumar
I am using Web service to upload file from silverlight client. I managed to upload files successfully using below code[webservice] from same computer but i get error on uploading from network.I tried fixes like setting file permissions to full, but none worked.using System;using...
18 Jul 2015 by Sem.Shekhovtsov
Before checking the code, make sure that saving files is ENABLED in client browser settings. If it's not, you won't be able to write to the disk and save files.Secondly, in the Silverlight application you should write to the Application Data storage only:if...
17 Jul 2015 by David A. Gray
With the XCeed FTP library, that's easy, because the data source can be an open stream. I suspect you can do the same with other libraries that give you a similar level of access to the FTP transfer process.
17 Jul 2015 by Himu from Orissa
How do i upload a file using ftp while it is being created. For example when i am creating a large video in case of capturing a camera recording, i want to move it to some other location.Any help would be greatly appreciated.
14 Jul 2015 by Member 10875212
thanks for your support but i have created two folders and create a function to move the files that uploaded by user to the second folder after certain period
13 Jul 2015 by Sergey Alexandrovich Kryukov
You don't know what kind of client which would require some installation you keep and mind and why could it help you to write this code.You can avoid installing anything when you use some .NET-native some library available in source code, a library containing client-side SFTP code. For...
13 Jul 2015 by Baskar Gs
Hi,I want to transfer a file from more than one client to server.so i am decided to create WPF .Net application and then I will share the application to my clients. With use of WPF application client just mention the local file path. other things configured internally in the code. (Use...
8 Jul 2015 by Sergey Alexandrovich Kryukov
The whole idea behind ASP.NET, as well as all other server-side Web technology, is that you generate content in HTTP response dynamically, by processing HTTP request on the server side and doing required computations before sending the response. Essentially, this is all ASP.NET does.This...
8 Jul 2015 by ZurdoDev
There is no built-in way to do it. However, one way is to generate a timestamp and then encrypt it and put it into the querystring of the link. Then in your page that the link goes to, get the querystring value, decrypt it, and compare it to the system clock.
8 Jul 2015 by Member 10875212
I create ftp project or fileshare project to upload my files on ftp server then send email to the user to download this files in the link and i need to Prevent the user to use this link after specific time by code.
6 Jul 2015 by Kornfeld Eliyahu Peter
What physical path? It is a 'physical' file so must be stored in a physical path!MSDN:The MapPath method maps the specified relative or virtual path to the corresponding physical directory on the server.So it is all right...The SaveAs method will save the file in the physical path where the...
6 Jul 2015 by sunnykvinod
i want to upload a file to folder 'Documents' which is in root directory.below code does'nt work,but file is uploaded to physical pathprotected void Button1_Click(object sender, EventArgs e) { string filename = Path.GetFileName(FileUpload1.FileName); ...
4 Jul 2015 by Lalyka
I Solved it Finallythe problem is the "Submit" that I changed it to button so itdoes not send the whole file also after submitting the buttonI did this :input type="button" value="Upload" class="button" id="btnUpload" /> instead of input type="submit" value="Upload"...
2 Jul 2015 by Tadit Dash (ତଡିତ୍ କୁମାର ଦାଶ)
You need to set maxAllowedContentLength and maxRequestLength in web.config.Refer - Maximum request length exceeded[^]
2 Jul 2015 by Lalyka
I have wrote an upload file method in javascript to upload big files it slpits thefiles in blobs and reattach the blobs in server side again so I can upload big files but there is a problem... after the upload is done and I receive the file in server side (the fileuploads completely), it gives...
25 Jun 2015 by j snooze
Indeed the each gentlemen's comments are correct. Process.start from the system diagnostics libary is the console or client way to open a file or start a process(exe, bat file), that doesn't work on a web server because people browsing to your site aren't on the web server. It may work on...
23 Jun 2015 by Member 11670657
Hi, I have a action to download a PDF files from server. Any way at the local host it works correctly. but after host, it does not work correctly. any way after that i search over the internet, 6 hours googled. but no answer yet.---------------------------At the local host work using...
8 Jun 2015 by mahdi87_gh
I moved uploader process to a new application which won't keep the main site's process busy.
6 Jun 2015 by OriginalGriff
You can;t save to URL's - which is what "http://..." is: it's a URL, not a path.Try using:string filePath = Server.MapPath("~/images/pic1.jpg");
6 Jun 2015 by decisive reason
i have my website hosted on a server and i have a folder their named images.I am recieving a base64 string and convert it into an image and saving it in my local directory and it works perfectly.[WebMethod]public void UploadPics(String imageString){ //HttpRequest Request = new...
27 May 2015 by mahdi87_gh
I hosted an ASP.NET MVC5 web application on a windows server 2008 R2 SP1. in this website there is a upload file section which users can upload large files with max size of 1 GB. When they click on upload button another popup window will be opened to allow users do other things during files are...
31 Mar 2015 by Herman<T>.Instance
Use BinaryReader and BinaryWriterexample:Byte[] DocDataStream;using (FileStream stream = File.Open(OriginalPDFFileName, FileMode.Open)) { using (BinaryReader br = new BinaryReader(stream)) { ...
31 Mar 2015 by Hitesh_Bhatt
byte[] bytes = System.IO.File.ReadAllBytes(@"C:\SGO3-1.pdf"); // MemoryStream outPDF = new MemoryStream(); FileStream outPDF = new FileStream(@"C:\pdf1.pdf", FileMode.Create); // byte[] outBytes; ...
1 Mar 2015 by Abhinav S
The path on the client side will not be sent to the server - Get Full Path from FileUpload control in ASP.Net[^].Just the file will be transferred.
1 Mar 2015 by ENG.Samy Sammour
I am trying to make a multiupload code.with two button :add : to add the file from fileupload to a list.upload : to upload all the file from the list.in the list i am saving :Vale = the file name.FullPath = full path from the client side.and i want to upload them from the...
11 Feb 2015 by kubi081
I have tried almost any suggestion I have found, but I couldn't make it work html file upload to work in Android WebView! I would really appreciate any help,Thanks
3 Feb 2015 by stitchypoohpika
I stored multipartfile to session and I retrieved it to display in table. when I click on this file, I got the error as follow,This is my coding in controller. If I upload 12KB size pdf file,it has no error. but when I upload 14KB size file, it shows error LikeFIle has been moved - cannot be...
31 Jan 2015 by BirjuGohel
I have solution this problem .. [WebMethod] public void UploadFileServer()//string filename { string filename = @"D:\Old Songs\R.D.Burman\019__HUMEIN_TUMSE_PYAAR_KIT.MP3"; // @"D:\Old Songs\R.D.Burman\015__SAGAR_KINARE.MP3"; //+...
31 Jan 2015 by BirjuGohel
I have Create a Web ServiceAnd Android Side Upload File (And Video file Part in multiparty and send Android Application Multiparty file and File name )Android Request send two Parameter in asp.net web service,So How to Store Server Folder in Video File Asp.net Web service...
27 Jan 2015 by BirjuGohel
I have 1 Gb Video File Upload in my server folder ,But error generateError : HTTP Error 404.13 - Not FoundThe request filtering module is configured to deny a request that exceeds the request content length.Most likely causes: Request filtering is configured on the Web server...
27 Jan 2015 by Afzaal Ahmad Zeeshan
The problem is that inside your web.config your default size for the file is set to be 4mb (4mb is default, so even if there is no settings set then 4mb size would be define as the value for maxRequestSize attribute of the HttpRunTime). A solution to this would, be, to change that value and...
21 Jan 2015 by benzimen
I want to upload Excel file by using Java script? I dont know how to start it.and i had done this in c#. please give me your valuble suggistions.
18 Jan 2015 by Member 11092009
How to asynchronous File Upload with blueimp's jQuery file upload pluginhttps://github.com/blueimp/jQuery-File-Upload/wiki/Client-side-Image-Resizing[^]
13 Jan 2015 by shaw2thefloor
Have you had a look at blueimp's jQuery file upload plugin....I think it will do exactly what you want. https://github.com/blueimp/jQuery-File-Upload/wiki/Client-side-Image-Resizing