.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

Upload large file via webservice problem in vb.net 1.1

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
Hi All, I am uploading large file via webservice using below my code in vb.net 1.1. Problem is vb.net 1.1 don't know Using Object loop. I would like to know any other loop similar Using loop to replace in vb.net 1.1Public Function UploadLargeFile(ByVal FileName As String, ByVal buffer As Byte(), ByVal Offset As Long) As Boolean Dim retVal As Boolean = False Try Dim FilePath As String = Path.Combine(System.AppDomain.CurrentDomain.BaseDirectory.ToString() & "\fpath\", FileName) If Offset = 0 Then File.Create(FilePath).Close() End If Using fs As New FileStream(FilePath, FileMode.Open, FileAccess.ReadWrite, FileShare.Read) fs.Seek(Offset, SeekOrigin.Begin) fs.Write(buffer, 0, buffer.Length) End Using retVal = True Catch ex As Exception Throw ex End Try Return retVal End Function  

View Complete Post

More Related Resource Links

Large File upload Problem.


I have problem with large upload files. few user complianing about it that either their file fails to upload or taking 20 to 30 mins.

I setup everything correct and i check on different machine its worked fine but only few customer out of 5000 complain it. any idea about if i can check at client machine?

i set my upload limit as 100mb and properly configured and i test it but one strange thing happen, when i try to upload group of files more then 100MB (but no individual file in the group more then 100), sharepoitn let it do and i can see 300MB group of files at once with explorer view.

my understanding when you set the limit it must be for individual or group of files. any thought?


thanks in advacne



i am at SharePoint administrator

File Upload Problem

I have a colleague that just cannot upload any files over 6mb to sharepoint. I have checked all his IE settings and everything is normal / the same as mine. anyone come across this before?Sharepoint Customiser

file upload problem


Hi Al,

 I am trying to upload excel file to database but i am getting error there is no row at postion 0. I am trying to save fileupload path its working in another system but is not wroking in my laptop.

   not getting full path of the file.

string filePath=@FileUpload1.postedfile.FileName.


 In another system i am getting full path of the excel file but in my laptop i am getting only  file name but not full path

File Upload Problem in ASP.NET



    I have an application hosted in windows server 2003.I have problem in uploading large files. I have set maxRequestLength.

    < httpRuntime maxRequestLength = "102400" executionTimeout = "3600" />

   Also I tried this

    < security >
< requestFiltering >
< requestLimits maxAllowedContentLength = "1024000000" />

Some problem in Data Flow while upload a "||" seperated text file


I am facing one problem with sql 2005 SSIS while uploading a "||" seperated text file with Data Flow in SSIS.Below I am giving the sample data of the text file



When I uploaded it using sql 2000 DTS it was not giving and it was being uploaded into the table but when I tried with SQL 2005 it is giving the below problem.

"[Flat File Source [1]] Error: Data conversion failed. The data conversion for column "Column 2" returned status value 4 and status text "Text was truncated or one or more characters had no match in the target code page.". "



.xoml.rules file upload problem in SharePoint 2007


I want to create programmatically a workflow like SharePoint Designer does, it works for the actions and the creation of the *.xoml workflow file but I can’t upload or create an *.xoml.rules file for the conditions, immediately after upload it disappears and I don’t know why. Any file with the extension of .rules is not accepted by SPD, is there something that forbids the upload?

Any help would be greatly appreciated,

Regards ,Clau

Problem with upload a file with special characters for the contribute permission users



I have a problem when a user with contribute permission try to upload a file with special characters, it gives a access denied error.

Is there a way to solve this problem?


File Upload custom Control problem


Hello All,

I am trying to build a custom control that requires that all the uploaded files should in the database.  I have saved them successfully but when i retrieve them using Generic Handler then the image is always shown broken. I have tried alot but this happens again. Below is my code of the handler.


<%@ WebHandler Language="C#" Class="Handler" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using System.IO;

public class Handler : IHttpHandler {
    public void ProcessRequest (HttpContext context) {
        //SqlConnection con = new SqlConnection();
        //con.ConnectionString = ConfigurationManager.ConnectionStrings["connString"].ConnectionString;
        SqlConnection con = new
          SqlConnection(@"server=BEHROZ\SQLEXPRESS;database=UserControl;Integrated Security=SSPI;");

        // Create SQL Command 
        DataTable dr = new DataTable();

        SqlCommand cmd = new SqlCommand();
        cmd.CommandText = "Select Image from TempImage";
        cmd.CommandType = System.Data.CommandType.Text;
        cmd.Connection = con;


        SqlDataAdapter sa = new SqlDataAdapter(cmd);
        SqlDataReader dReader = cmd.ExecuteReader();

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!!!!

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.

While Importing Excel 2007 file to Datatable - headerrow problem


Hi there,


I am trying to simply extract an excel data from an uploaded file an put it into a datatable. In this case the excel file has 3 rows but when I fill the datatable I only see row count of 2.

I tried changing HDR:NO; to HDR:YES and vice versa, but no luck. 

What am I doing wrong? (Note: the excel file cannot have a  headerrow)


string connstr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + pFilePath + ";Extended Properties=\"Excel 12.0;IMEX=1;HDR:NO;\"";
            OleDbConnection conn = new OleDbConnection(connstr);
            DataTable dtTables = conn.GetOleDbSchemaTable(System.Data.OleDb.OleDbSchemaGuid.Tables, null);
            string strTablename = dtTables.Rows[0]["TABLE_NAME"].ToString();
            string strSQL = "SELECT * FROM [" + strTablename + "]";

            OleDbCommand cmd = new OleDbCommand(strSQL, conn);

            DataTable dt = new DataTable();
            OleDbDataAdapter da = new OleDbDataAdapter(cmd);
            //At this point row count=2 which doesn't make sense




Problem in accessing resource file dynamically.


Steps I have followed are
1.I have created myres.en-GB.resx file at C:.
2.then created locale specific myres.en-GB.resources using resgen at c: only,
resgen c:\myres.en-GB.resx
3.Linked the Resource File to Assembly using AL.exe which is giving me assembly at c: only.
Al /t:lib /embed:myres.en-GB.resources /out:ClassLibrary1.dll
4.I have created one web application using vs 2008 & then build it.
5.Then placed both resource file & dll in web applications Bin\en-GB folder.
6.Anf finally written code at page load like
 CultureInfo info = new CultureInfo("en-GB");
            Thread.CurrentThread.CurrentCulture = info;
            Assembly asd = Assembly.Load("ClassLibrary1");
            ResourceManager res = new ResourceManager("myres.en-GB", asd.GetSatelliteAssembly(info));
            string sdf = res.GetString("Lab1");

but after running application I m getting following error
MissingManifestResourceException", "Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Cla

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" />

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