Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6
This is the forum to discuss the Wrox book ASP.NET 2.0 Instant Results by Imar Spaanjaars, Paul Wilton, Shawn Livermore; ISBN: 9780471749516
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 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 February 6th, 2010, 05:30 PM
Fed Fed is offline
Authorized User
 
Join Date: Oct 2009
Posts: 55
Thanks: 26
Thanked 0 Times in 0 Posts
Default file share app

Hi Imar,

In chapter 18 of your beginning asp.net you instructed on how to deploy the website using IIS. I followed that exercise and set the begaspnet/release directory as the home directory of the IIS default site. While experimenting with the file share app to get it to run after installing it as a hosted web site. I noticed that for some reason the file share app was putting pieces in begaspnet/release. Thinking that this was why I couldn't get the file share to run using the installation program I went back into IIS, removed the begaspnet/release and replaced it with inetpub\wwwroot. Needless to say it did not make any difference, the damn app will not run when installed using the installation program included in the chapter's source directory. My question is, why did you set up the exercise in beginning asp.net to modify the IIS's default website? And is there another way to setup IIS so you can have multiple websites running/testing on it at the same time?

I did get the app to run by installing it following the directions for the "local developer installation" but only after deleting the default.aspx file created by VS when creating a new website in preparation to copy the file share app code into solution explorer. So all the pieces work fine except the final one when you click on the link to "technically" download the received file. To clarify, I get the email that notifies me a file was sent "from" "to" etc.
When I click the link in that email which is;

'http://localhost/FileShare/Download.aspx?resourceID=44'

I get;

Server Error in '/FileShare' Application.
--------------------------------------------------------------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested URL: /FileShare/Download.aspx

Now I did notice that the Download.aspx is actually nested one level deeper in the directory tree of the app, FileShare/ContentFiles/Download.aspx is that the problem?

I am also sorry that I have to bother you with this and you didn't even write it but I cannot get a hold of the author. The only link I found was to his blog and it looks like he hasn't used it since 2008. Would you happen to know how I can reach him?

Thanks,

Fed
 
Old February 6th, 2010, 05:54 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
My question is, why did you set up the exercise in beginning asp.net to modify the IIS's default website? And is there another way to setup IIS so you can have multiple websites running/testing on it at the same time?
Because it's only way to do it when using Windows XP. And I didn't want to set up the site as a Virtual Directory as it's likely you want a root based site on your production server as well.
Quote:
Now I did notice that the Download.aspx is actually nested one level deeper in the directory tree of the app, FileShare/ContentFiles/Download.aspx is that the problem?
Quite possible. Maybe this is simply a bug as the path seems OK to me. Check out the code that sends the message and if you can confirm the logic (or lack thereof).

Quote:
Would you happen to know how I can reach him?
Nope; haven't spoken to him for a while either. You could try Wrox support if you have a problem with the code.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Fed (February 6th, 2010)
 
Old February 6th, 2010, 09:56 PM
Fed Fed is offline
Authorized User
 
Join Date: Oct 2009
Posts: 55
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Hi,

the file share app refers to a global.asax file to do all the event handling in. Is it worth learning or is it an obsolete asp.net 2.0 technique?

Thanks,

Fed
 
Old February 7th, 2010, 06:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

The code in FileShare refers to handling the code in Global.asax, but doesn't actually implement it ;-) (at least, I can't find it)

Take another look at Chapter 17 of Beginning ASP.NET 3.5. It uses the same Global.asax to handle site wide errors. So yes, it's very common to do so and not an obsolete technique. FileShare just doesn't implement it.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Fed (February 7th, 2010)
 
Old February 7th, 2010, 11:53 AM
Fed Fed is offline
Authorized User
 
Join Date: Oct 2009
Posts: 55
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Yeah I saw that late last night when I was reviewing ch. 17 to figure out what was the best way to validate the input fields. He does one accidental validation on the file upload field in the code behind of the default.aspx. He uses If FileUpload1.FileName <> "" Then
'upload the file to the server...

Else returns control to the default.aspx form... But no validation whatsoever on the email fields so at first I was looking into using the Messagebox.show in the vb code itself but I kept getting an error saying that message.box was not declared/derfined and in the examples I was looking they were used without any declaration. So I then rmembered your required field validator in the form and am looking to implement that method now because why put the validation on the server when I can do it on the client?

Is there any way to test for the validity of an email? To prevent people from putting bogus emails? You know like sending out a ping or something to see if the email really exists and is valid?

Thanks

Fed
 
Old February 7th, 2010, 12:09 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It can be done, but you need external software to do it:

http://www.google.com/#hl=en&q=valid...64f927cfe7b756

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Fed (February 7th, 2010)
 
Old February 7th, 2010, 12:21 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

BTW:
Quote:
because why put the validation on the server when I can do it on the client?
You have no idea how many reasons there are to do it at the server. You could start by checking out page 294 of my Beginning ASP.NET 3.5 book.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Fed (February 7th, 2010)
 
Old February 7th, 2010, 12:34 PM
Fed Fed is offline
Authorized User
 
Join Date: Oct 2009
Posts: 55
Thanks: 26
Thanked 0 Times in 0 Posts
Default

Point taken. But do you agree that server based validation for the file share app is overkill? I mean 4 fields, 2 emails, 1 message and the file upload from one's own computer...

Fed
 
Old February 7th, 2010, 12:40 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, it's not overkill if you ask me. Especially when allowing users to upload files I would check and double check if I only get the stuff I want. I rather not have .exe or scary .aspx files uploaded to my server..... ;-)

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
The Following User Says Thank You to Imar For This Useful Post:
Fed (February 7th, 2010)
 
Old February 7th, 2010, 04:42 PM
Fed Fed is offline
Authorized User
 
Join Date: Oct 2009
Posts: 55
Thanks: 26
Thanked 0 Times in 0 Posts
Default

I see, said the blind man... Huh, wouldn't those scary files have to be "run" in order to do damage? Can they be coded to "run" automatically? I know that if I download an exe that contains malicious code I have to run it in order to release its "cargo", doesn't that apply to files uploaded to a server as well?

How do I check for bad .exe, aspx, and whatever else they may throw my way?

Thanks,

Fed





Similar Threads
Thread Thread Starter Forum Replies Last Post
File Share App Fed BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 6 February 4th, 2010 06:26 PM
about File share project netdemon BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 2 April 17th, 2008 08:06 PM
Wrox File Share - 1g file size limit b67 BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 May 7th, 2007 04:24 PM
file in a share mode m_rajib74 C# 1 January 24th, 2007 03:26 PM
File Share App Error aaaboye BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 1 October 16th, 2006 03:32 PM





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