.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

FTP resume upload

Posted By:      Posted Date: September 07, 2010    Points: 0   Category :.NET Framework
Hi, I am a newbie to C#.Basically what my problem is that when my friends uploaded files(~400mb),as his connection to the internet is not good,the connection usually broken halfway and the ftp will try to reconnect the connection again.However, this makes the uploading process starts from 0% again. How can the ftp resume/pause the uploading process?I have read about resume/pause the downloading for ftp but I can't do it. My code is as below private void SendToFtp(int resend, string filename, string ftpServerIP, string userName, string Password) { try { long tempFileSize = 0; FileInfo fileInf = new FileInfo(filename); string uri = "ftp://" + ftpServerIP + "/" + fileInf.Name; FtpWebRequest reqFTP; reqFTP = (FtpWebRequest)FtpWebRequest.Create (new Uri("ftp://" + ftpServerIP + "/" + fileInf.Name)); reqFTP.Credentials = new NetworkCredential(userName, Password); reqFTP.KeepAlive = false ; if (resend == Resend) reqFTP.Method = WebRequestMethods.Ftp.UploadFile; else {

View Complete Post

More Related Resource Links

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Strange Photo upload problem


I'm working project it's live on shared hosting

we'er uploading photos to a file on the server everything works fine the photo is resized renamed and sent to the folder

the upload page returns the thumbnail and the full size photo it's there all the photos have to be approved by an admin

twice now after they have been approved they disapear I checked the folder they are not there could there be anywhere

on the server they could get hung up before they go into the folder I have it setup so when you delete the data base entry it deletes the photo from the folder othe than that you need to open the folder and delete the photo this has hapened twice now I tried to recreate it with no luck

thaks for your help in advance

file upload in chunks or not buffering in memory before writing to disk?


What are the options for handling file uploads to reduce the memory footprint?  Is there a way to upload in chunks?  Is there a way to stream upload directly to disk instead of loading entire file in server memory?


upload file not working



iam using masterpage and ajax update panel, i have child page called  fileupload.aspx,i try to upload the file

but its not working , can i use updatepanel in child page , pls very urgent

looking forward for answer.

Upload a Print Screen?


Is it possible to Print Screen and then immediately Paste into a .NET app and upload to a server?  I'd like to skip the step of the user having to first paste the screen into an image program and save as a jpg, gif, etc.  Thanks!

Upload transparent PNG image


Hi everybody

I'm creating a website where it must  be able to upload, crop and resize images. This works until I use transparent PNG images. When I upload a transparent PNG, the transparency becomes black. I've searched the whole internet, but found no solution so far. Can someone help me? This is my code. I'm working with MVC 2.

			try {
				HttpPostedFileBase file = Request.Files["image"];
				file.SaveAs(Server.MapPath("/Uploads/" + file.FileName));

				ViewData["ImageLocation"] = "/Uploads/" + file.FileName;
				return View();
			catch (Exception exc) {
				return RedirectToAction("UploadImage");

How to upload image in Mobile Application?


I have requirement to upload the image in mobile Web application using asp.net. For this I have add mobile templates but regarding to image there is no any file upload control. Then I see one article and use the below code:

<mobile:DeviceSpecific ID="DeviceSpecific1" Runat="server">
                <input style="width: 389px; height: 22px" type="file" size="45" runat="server" id="FileUpload1">

Upload multiple files in asp.net

The article Upload multiple files in asp.net was added by habdulrauf on Friday, July 09, 2010.

Some times we need to allow user to upload as many files as he/she wants instead of fixed number of files.So here is the procedure to achieve this. Idea is taken from Joe's video.%@ Page Language="C#" AutoEventWireup="true" CodeFile

ASP.NET HTML Editor - Upload images

The article ASP.NET HTML Editor - Upload images was added by adarshtated on Tuesday, June 29, 2010.

In this article we are seen how to create a custom HTML Editor control to add image button in it.Create A Class-----------CustomEditor.cs------------------Add Name Spaceusing AjaxControlToolkit.HTMLEditor;namespace MyControls{ public class CustomEditor

file upload in Create User Wizard Created User event with UpdatePanel Tag wont work?



In my Create User Wizard1 Created User Wizard Event, I am collecting extra information from text boxes and allowing

the user to uplad a file.



I have put the Submit button within an Update Panel Tag but since I have done this it does not work.

Is there a way round it. In this situation would you use a trigger.?


<br />

  <asp:UpdatePanel ID="UpdatePanel2" runat="server">

  <asp:Button ID="StepNextButton" runat="server"  CommandName="MoveNext"  align="middle"
                                            Text="Submit my Profile" />

Attachment upload error on browser based InfoPath form



I am having an interesting problem with browser based InfoPath forms in SharePoint 2007.  For some reason the file attachment control is not working any more.  It was working fine in July, but now it will not allow file attachments over a few kb.  I tried a 34KB file and I get the error below, a 2KB file works fine.

Unable to connect to SQL Server session database. The connection string (server='SPDB', database='SharedServices1_DB') was returned by an instance of the IPartitionResolver type 'Microsoft.Office.Server.Administration.SqlSessionStateResolver, Microsoft.Office.Server, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.   at System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection conn, Exception e)
   at System.Web.SessionState.SqlSessionStateStore.HandleInsertException(SqlConnection conn, Exception e, Boolean newItem, String id)
   at System.Web.SessionState.SqlSessionStateStore.SetAndReleaseItemExclusive(HttpContext context, String id, SessionStateStoreData item, Object lockId, Boolean newItem)
   at System.Web.SessionState.SessionStateModule.OnReleaseState(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEven

'An unexpected error has occurred' on upload after changing limit



I recently changed the max upload size for attachments to TFS work items on our SharePoint site.  I did this by going to the http://tfsserver1:8080/tfs/ProductCollection/WorkItemTracking/v1.0/ConfigurationSettingsService.asmx?op=SetMaxAttachmentSize URL and entering the new size in bytes.

This worked a treat, but not I cannot upload any documents to another site on the same server.

I can open and save documents that are already there, but when I click the 'Upload' button it gives a white page with 'An unexpected error has occurred.' on it.

Is there something else I have to set when I increase the upload limit for work items?


Asp.Net upload file access denied



I have the problem below, if anyone can help me, appreciate it.

Server Error in '/' Application.

Access to the path 'c:\Inetpub\EnewsAttFiles\employ-e-header2.jpg' is denied.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.UnauthorizedAccessException: Access to the path 'c:\Inetpub\EnewsAttFiles\employ-e-header2.jpg' is denied.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. ASP.NET has a base process identity (typically {MACHINE}\ASPNET on IIS 5 or Network Service on IIS 6) that is used if the application is not impersonating. If the application is impersonating via <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.

To grant ASP.NET access to a file, right-click the file in Explorer, choose "Properties" and select the Security tab. Click "Add" to add the appropriate user or group. Hig

Reg File Upload control to upload files from document library


In Field Upload control if we click browse button it allow us to search file in our hard disk but now as per my requirement as soon as user clicks ‘Browse’ button it should point to the document libraries and their files in site.Let me know how could i achieve this?

Thanks & Regards,

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend