Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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 12th, 2013, 01:24 AM
Authorized User
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default Chapter 14 - FileUpload.saveas()

Hello,

I have followed and used your example in the ManagePhotoAlbum class to implement attachment functionality. I have a conceptual question, and a specific one that I'm currently wrestling with. I implemented it so that the path to save files is on our local network file server, as opposed to your example of the app folder GigPics.

Conceptual:
When saving a file to a location other than the web server and calling the FileUpload.SaveAs() method, is what's really going on behind the scene the file is copied to the server first during post back, then saved to the network folder? Or does it get saved directly from my client to the network folder?

Specific:
The site I'm enhancing has been up and running since Nov. The new attachment functionality worked wonderfully running locally until I deployed the new functionality on our 2008R2 Web Server running IIS7. Now I get access permissions denied when trying to attach files. When setting up the application, I used your instructions on setting app pools and NTFS permissions, etc. (that's how I got the site up and running in the first place.) From reading about it, it sounds like it has something to do with the account the application is running under (ASPNET), although answers on msdn and forums seemingly stop there - saying to grant the application account access to where you store the files. Where's this account at and how do you make those changes? Any thoughts or recommendations from experience?

Thanks very much,
WebDev123
 
Old February 13th, 2013, 02:37 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>> s what's really going on behind the scene the file is copied to the server first during post back, then saved to the network folder?

It's uploaded to the server first. Otherwise, that would be a huge security issue. You don't want the whole world to upload files to your network machine just like that.

>> From reading about it, it sounds like it has something to do with the account the application is running under (ASPNET)

That's most likely that. What the account is, depends on many factors. By default recent versions of IIS create an account on the fly named after the application pool (which is by default named after the web site). Appendix B and chapter 19 have more on this. To answer the question for your situation, I need a lot more info such as:

1. Windows version
2. Application pool set up (Integrated or classic)
3. Account used by the application pool.

More info can also be found here:

http://imar.spaanjaars.com/290/how-d...-and-databases
http://imar.spaanjaars.com/287/how-d...un-my-web-site

Although both of them are a bit outdated.

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!
 
Old March 29th, 2013, 12:32 AM
Authorized User
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default

Yes, the file is uploaded to the server during postback, and while processed on the server, it is copied to another file server on our network. To be honest I didn't find the answer from Appendix B and Chapter 19, thus the question. However, I understand that this isn't the Professional version of the book that might provide more details for a corporate environment.

With experimentation and help from our IT group, I was able to solve it. So perhaps someone else out there would benefit. IIS 7.5 on Windows Server 2008R2 by default creates a group called IIS_IUSRS, under which the application operates. See "IIS_IUSRS (a new built-in group), as it replaces IIS_WPG and is already granted the minimum rights required to start up a worker process." at http://blogs.msdn.com/b/rodneyj/arch...on-part-i.aspx.

In addition, we had a new application account created on our domain that I was able to use for the integrated application pool. It has access to the file share on the file server thereby allowing the .NET IO code to succeed.

Thanks for the insights. Will you be coming out with a 2012 book? Also, will you be offering a Professional book?

One last comment on the 2010 book style: The integrated excercises could be placed at the end of the conceptual discussion instead of after ("How it works" I think is what you call it). Perhaps more emphasis could be placed on the conceptual side with diagrams, images etc. before getting into the detail. That would provide a high-level scope or context (boundries) to the activities, so that the reader understands where it fits into the development process prior to getting into the nitty-gritty.
 
Old March 29th, 2013, 04:10 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The reference to Appendix B was about finding out the account that's being used. In your case, you solved it by using a domain account that has access to both machines. Glad you got it working.

>> Thanks for the insights. Will you be coming out with a 2012 book? Also, will you be offering a Professional book?

Yep, and it's already available: http://www.wrox.com/WileyCDA/WroxTit...118311809.html

Wrox will also release the Professional version of it soon, but I wasn't involved in that book.

Thanks for the suggestions for the exercises.

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!
 
Old July 6th, 2013, 05:10 PM
Authorized User
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default New book: Beginning ASP.NET 4.5: in C# and VB

Imar,

We've just switched over to Visual Studio 2012 Express at work, which of course uses 4.5 .NET Framework. The biggest change for me is the interface and new web project configuration/solution.

Therefore, I want to buy your book on 4.5, published in November 2012. However, I need to confirm with you that it does in fact explain the new Visual Studio. If it didn't include that it wouldn't be useful. I assume it does but wanted to make sure.

Also, you haven't changed the cover; does that imply not much has changed? It is now July of 2013. Since November of 2012, there certainly have been enhancements. Are new enhancements included for each batch of publications? Or, is it ONLY what you wrote last year?

Thank you,
WebDev123
 
Old July 7th, 2013, 05:03 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Yes, the ASP.NET 4.5 book discusses the latest released version of Visual Studio: VS 2012.


Quote:
Also, you haven't changed the cover; does that imply not much has changed?
On the contrary. For some reason, Wrox decided to use the same cover. However, the book has been fully updated for the new VS 2012 IDE and ASP.NET 4.5 framework.

Quote:
It is now July of 2013. Since November of 2012, there certainly have been enhancements. Are new enhancements included for each batch of publications? Or, is it ONLY what you wrote last year?
Since November, Microsoft has released various minor updates for VS with Update 3 being the most recent one. These are not covered in the book. However, these updates don't affect the stuff discussed in my book or ASP.NET in general and revolve mostly around advanced IDE features.

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!
 
Old July 7th, 2013, 11:45 PM
Authorized User
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default ASP.NET 4.5

Thanks buddy. Good clarification - I just bought the book on Amazon. Yeah, the project structure and default files and templates seem to be different enough to spend some time looking into. See you in the 4.5 forums!
WebDev123





Similar Threads
Thread Thread Starter Forum Replies Last Post
help in chapter 14 please nawar youssef BOOK: Beginning PHP 5.3 3 October 27th, 2011 11:36 PM
Chapter 14, first 'Try It Out' alharlow BOOK: Beginning ASP.NET 4 : in C# and VB 5 March 18th, 2011 05:00 AM
Chapter 14 example pkumar@ech BOOK: Professional Jakarta Struts 0 November 15th, 2006 09:10 AM
Chapter 14 JonG BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 21st, 2006 10:04 PM
Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 2 January 4th, 2004 05:13 PM





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