.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 16th, 2003, 09:22 AM
DAREEL DAREEL is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 6 DAREEL User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
upload file system

HELLO EVERYONE

Me and my mate are hoping to design somekind of upload system that allows users to upload files onto a server. We are then hoping to use it on a forum that allows the users to upload their stuff for all to see. Now we have very little programming experience but have been told it can be done easily enough and told that ASP.NET is the best option for beginners. Just wondering if any of you can reccomend and decent books ,web links or even examples that would help us to design this

Any help appreciated and thankyou again

Last edited by DAREEL : November 16th, 2003 at 09:25 AM.

Reply With Quote
  #2  
Old November 23rd, 2003, 08:11 PM
neuralSea neuralSea is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 15 neuralSea User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Answer to how do I upload a file to a server?

Hi Darrell,

Easiest way is to use HTML file/post (a one-liner - my html is a little rusty so just do a quick google search on "file object html upload"). The main problem is that with this method some nasty person could upload anything to your server (e.g., nasty CGI scripts that could wipe out files) - so best to limit the file size/type/text size etc when you are using it. Sorry - just viewed the source of this page with the attach file: section below and this is it - :-)

<tr>
<td bgcolor="#dedfdf" valign="top"><font face="verdana, arial, helvetica" size="2" ><b>Attach file:</b></font><br>
<font face="verdana,arial,helvetica" size="1" >Maximum size: 2097152 bytes</font></td>
<td bgcolor="#dedfdf" valign="top"><font face="verdana,arial,helvetica" size="1" ><input type="hidden" name="MAX_FILE_SIZE" value="2097152">

<input type="file" class="bginput" name="attachment"><br>
Valid file extensions: gif swf jpg zip php tar gz sit php3 png java jsp asp py zexp xml txt pdf pl txt html shtml htm pm tgz</font></td>
</tr>

Cheers,

neuralSea

P.S. you probably have the answer by now anyway but I still hope this helps a little)

Reply With Quote
  #3  
Old December 3rd, 2003, 05:00 PM
Syngin Syngin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Windsor Ontario
Posts: 155 Syngin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 h 6 m 36 sec
Reputation Power: 8
Send a message via MSN to Syngin
This will work in .NET. This is actually a popup window page that wil allow you to choose a local file to upload and then refreshes the parent page once it is closed:

Quote:
<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="iso-8859-1" %>
<script runat="server">
void Button1_Click(object Source, EventArgs e)
{
string strFileName;

if (txtFile.PostedFile != null) {
strFileName = txtFile.PostedFile.FileName;
strFileName = strFileName.Substring(strFileName.LastIndexOf("\\")+1);
try {
txtFile.PostedFile.SaveAs(Server.MapPath("../pdf_files/"+strFileName));
txtMsg.InnerHtml = "Uploaded successfully<br>";
}
catch (Exception err) {
txtMsg.InnerHtml = "Error Uploading<br>";
}
}
}
</script>
<html>
<head>
<title>Upload PDF File</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="../ic-admin.css" rel="stylesheet" type="text/css">
</head>
<body onunload="opener.location=('default.aspx')">
<div align="center"><b><br>
Upload a PDF:</b>
</div>
<form id="frmUp" enctype="multipart/form-data" runat="server">
<div align="center">Select PDF for upload:<br>
<br>
<input type="file" class="button" id="txtFile" size="35" runat="server">
<br>
<span id=txtMsg runat="server" />
<br>
<input type=button class="button" id="Button1" value="Upload PDF" OnServerClick="Button1_Click" runat="server">
<br>
<br>
</div>
</form>
<div align="center">
<form name="form1" method="post" action="">
<input name="Submit" type="submit" class="button" value="Close This Window" onClick="javascript:window.close();" >
</form>
<br>
</div>
</body>
</html>
__________________
Where are we going and why am I in this handbasket?

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > upload file system


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT