473,378 Members | 1,541 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Have problems with file upload....

I can do this with ASP.NET but the project I'm working
with is all written in C# and all in the .cs file using
WriteLine. I have tried a number of things to get at the
uploaded file, but with no success. I thought since it was
running on the Server I could use the same type of
ServerClick event to catch this but no luck. Can someone
enlighten me?

BTW: Why doesn't if(myPost.PostedFile!=null) not work. It
doesn't stop if click the button without a file listed in
the type=file textbox.

Code below.

public void DisplayFileUpload(HtmlTextWriter writer)
{
writer.WriteLine("<table border='1' cellspacing='2'
cellpadding='2' class='form'>");
writer.WriteLine("<tr><td><h5> Select the File to
upload</h5></td><tr>");
writer.WriteLine("<tr><td>");
writer.WriteLine("<input type='file' id='ulFile' size='35'
runat='server'>");
writer.WriteLine("</td></tr>");
writer.WriteLine("<tr><td>");
writer.WriteLine("<input type='hidden' value='uploaded'
name='test'>");
writer.WriteLine("<input type='submit' value='Upload'
OnServerclick='UploadFile_ServerClick;' runat='server'
name='UploadFile' id='UploadFile'>");
writer.WriteLine("</td></tr></table>");
}
thanks
Nov 15 '05 #1
0 911

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Geoff Soper | last post by:
I'm having problem with images becoming corrupted after loading them into a MySQL database and extracting them again. I'm pretty sure it's todo with escaping slashes but I'm at a loss as to how to...
7
by: lion | last post by:
I get these errors when uploading images via a web page: (the page still uploads the images but reports these errors?) Warning: fopen(D:\php\uploadtemp\php1FC7.tmp) : failed to create stream: No...
0
by: Joseph Markovich | last post by:
I'm trying to write a script for my users to be able to upload large files, and now I am unsure what exactly I am doing wrong. My script is based on the one in the PHP manual. <?php if(isset(...
2
by: Christian Giordano | last post by:
Hi guys, I've an hosting in media temple (appliance-server) with plesk 7.5.1. I'm trying to bring make a CMS I did in another server to work there. The issues is related the file uploading, in fact...
3
by: jmlin84 | last post by:
I'm using the code: if(move_uploaded_file($_FILES, $target_path)) { echo "The file ". basename( $_FILES). " has been uploaded"; } else{ echo "There was an error uploading the file, please try...
4
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
0
by: Tim::.. | last post by:
Can someone please help.... I'm having major issues with a user control I'm tring to create! I an trying to execute a sub called UploadData() from a user control which I managed to do but for...
2
by: mark | last post by:
How do I detect that a particular form element is a file upload or if the file upload has worked? In the Python cgi module documentation I found suggested code... form = cgi.FieldStorage()...
2
by: Glenn Coyle | last post by:
Hi I am having issues with trying to upload files to a directory on my server. the first script is the form the second is the upload file, it just doesnt identify the file path where it is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.