Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2006, 06:15 AM
Authorized User
 
Join Date: Nov 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default File upload Problem, 0 byte!!!!

Hi people.
I have a ASP.NET Fileupload control in my page but some times it saves a file with 0 byte space!!! how can i handle this position and generally how can i make sure the file isuploaded succesfully???
 
Old December 7th, 2006, 06:41 AM
Authorized User
 
Join Date: Nov 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thout we can have another problem. If a file with the same name exists in our directory what will happen?
 
Old December 14th, 2006, 05:31 AM
Authorized User
 
Join Date: May 2006
Posts: 39
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The problem may be that you are selecting a file of 0 size.
you can visit for file upload control at following url

http://www.apnasaathi.blogspot.com
 
Old December 14th, 2006, 01:12 PM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes u should check the content before saving or check before loading the size of filee.g if it is more than 5 byte then it uploads
u will find whether this is problem or not

thanks......
 
Old December 16th, 2006, 09:20 AM
Authorized User
 
Join Date: Nov 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for your reply, but i don't select a file of 0 size. I tried many files.
Anyway thank you again for your help.
Quote:
quote:Originally posted by sh.rajkumar
 The problem may be that you are selecting a file of 0 size.
you can visit for file upload control at following url

http://www.apnasaathi.blogspot.com

 
Old December 16th, 2006, 09:26 AM
Authorized User
 
Join Date: Nov 2006
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

How can i check the content, may you bring a sample?
Quote:
quote:Originally posted by MunishBhatia
 Yes u should check the content before saving or check before loading the size of filee.g if it is more than 5 byte then it uploads
u will find whether this is problem or not

thanks......
 
Old December 19th, 2006, 07:20 AM
Friend of Wrox
 
Join Date: Aug 2006
Posts: 231
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi you can write this line above coding to upload the file suppose the name of control is fileupload1 then use:

if (fileUpload1.PostedFile.ContentLength > 0)
{
//here write the functionality to add code


}

thanks......





Similar Threads
Thread Thread Starter Forum Replies Last Post
Upload File problem khb3283 ASP.NET 2.0 Basics 1 October 3rd, 2008 01:14 PM
Problem to upload file imjigu2001 ASP.NET 2.0 Professional 2 March 26th, 2008 04:37 AM
File Upload Problem meetravig Pro JSP 0 July 14th, 2007 01:34 AM
strange file upload problem dan195 ASP.NET 1.0 and 1.1 Basics 0 January 28th, 2007 12:36 AM
File upload problem! Ashleek007 Beginning PHP 0 July 15th, 2005 11:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.