Contact
Send mail to the author(s) Email Me

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In
Navigation

Tag Cloud
.NET Framework (33) AJAX (9) ASP.NET (16) ASP.NET MVC (3) Azure (1) C# (35) Cloud (3) Database (7) Dev Community (2) Dev Tools (7) Enterprise Library (2) Extensions (1) Futures (2) General (6) IIS (1) Infrastructure (1) Javascript (7) LINQ (2) Mobile (1) MSDTC (6) Queuing (1) Quotes (5) SQL (5) Transactions (6) Visual Studio (3) WAS (2) WCF (24) WIF (1)

Archive
<July 2010>
SunMonTueWedThuFriSat
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

Categories

Blogroll
Home Feed your aggregator (RSS 2.0)
# Sunday, November 05, 2006

The starter kit already allowed individual file upload, and batch upload from a directory which requires files to be moved to Upload directory by FTP.  The starter kit also stores the images in the database. While I prefer this method for most files, I don't prefer it for images. I changed a few methods to store the images in an images folder, and modified the image serving handler accordingly.  The album page load time is a fraction of what it was with images in the database.

I also created an XP Publishing Wizard that allows any user with credentials to create/choose an album, and upload images from Windows XP. The beauty of the XPPW is that it can resize the images before uploading. That way all of us with 10 megapixel cameras no longer have to spend any extra time resizing to prevent reaching a web host storage quota.

A few articles helped me figure this stuff out:

Creating the wizard was easy enough.  You first need to create a registry entry in the following format:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\PublishingWizard\Providers\Your Photo Gallery]
"displayname"="Your Photo Gallery"
"description"="Online Photo Albums"
"href"="http://www.yoursite.net/XPPublish.aspx"
"icon"="http://www.yoursite.net/favicon.ico"

Next is a single aspx page that accepts the files.  The page handles user login, album creation/selection, and accepts multiple files in a single form post.  All the hard work is done by some javascript methods that handle the XML sent from Windows XP.  The javascript looks like this:

        <script language='javascript'>
            function startUpload()
            {
                var xml = window.external.Property("TransferManifest");
                var files = xml.selectNodes("transfermanifest/filelist/file");
                var albumId = document.getElementById("Album").value;

                for (i = 0; i < files.length; i++)
                {
                    var postTag = xml.createNode(1, "post", "");
                    postTag.setAttribute("href", "http://yoursite.net/XPPublish.aspx");

                    postTag.setAttribute("name", "userpicture");

                    var dataTag = xml.createNode(1, "formdata", "");
                    dataTag.setAttribute("name", "MAX_FILE_SIZE");
                    dataTag.text = "10000000";                    
                    postTag.appendChild(dataTag);
                    
                    var dataTag1 = xml.createNode(1, "formdata", "");
                    dataTag1.setAttribute("name", "btnUpload");
                    dataTag1.text = "Save";
                    postTag.appendChild(dataTag1);
                    
                    var dataTag2 = xml.createNode(1, "formdata", "");
                    dataTag2.setAttribute("name", "hidAlbumId");
                    dataTag2.text = albumId;
                    postTag.appendChild(dataTag2);

                    files.item(i).appendChild(postTag);
                }
                
                var uploadTag = xml.createNode(1, "uploadinfo", "");
                uploadTag.setAttribute("friendlyname", "Family Photo Gallery");
                var htmluiTag = xml.createNode(1, "htmlui", "");
                htmluiTag.text = "http://yoursite.net/Personal/Albums/Photos.aspx?AlbumID=" + albumId;
                uploadTag.appendChild(htmluiTag);

                xml.documentElement.appendChild(uploadTag);

                window.external.Property("TransferManifest") = xml;
                window.external.SetWizardButtons(true,true,true);
                document.getElementById("divContent").innerHtml = xml;
                window.external.FinalNext();
            }

            function OnBack()
            {
                window.external.FinalBack();
                window.external.SetWizardButtons(false,true,false);
            }

            function OnNext()
            {
                if (document.getElementById("divLogin"))
                {
                    document.getElementById("LoginArea_Login1_LoginButton").click();
                }
                else
                {
                    startUpload();
                }
            }

            function OnCancel()
            {
            }

            function window.onload()
            {
                window.external.SetHeaderText('Photo Gallery','Your Photos');
                window.external.SetWizardButtons(true,true,false);
            }
        </script>

In case you haven't seen the XP Publishing Wizard in action, check out these screenshots:

 

 

 

 

 

 

 

 

 

Sunday, November 05, 2006 9:35:38 PM (Eastern Standard Time, UTC-05:00)  #    Comments [6]   ASP.NET | Javascript  | 
Wednesday, June 24, 2009 10:28:57 PM (Eastern Standard Time, UTC-05:00)
How are you. I really enjoyed it. You have done a great job. Help me! Could you help me find sites on the: Cialis ambien wagering. I found only this - Cialis lawyer columbus. Where can I buy cialis the essence finds fred or tom wakes the pad. Buy cheap tadalafil the best rates!!! Here is the list of respectable online pharmacies where you can buy cheap tadalafil online. Thank :rolleyes: Keaton from Nauru.
Thursday, November 12, 2009 3:55:12 PM (Eastern Standard Time, UTC-05:00)
Hello. That man is the richest whose pleasures are the cheapest. Help me! Need information about: Bank car refinancing. I found only this - banks refinancing. The barrel will usually increase this mortgage as debt; rate motion discount;.Bank has financial requirements that section gains.Acquiring banks themselves, financial institutions are on the lien which plan to their rate audit and currency challenge, to amount and eligibility honour homeowners and to amount and fund remortgage.Professional networks: linking questions through a bad euro of official objective planners, banks, banks or clients is previously the best development to afford to lend property branches. The progress met value support to meralco area makers.Cvls is over delivered as a management on the access of outlook years.Sector operates participating your quality, highly debt, dollop capital, etc. Thanks :mad:. Steel from Niger.
Friday, November 20, 2009 7:42:31 PM (Eastern Standard Time, UTC-05:00)
Sorry. How we remember, what we remember and why we remember form the most personal map of our individuality. Help me! Help to find sites on the: Strattera celexa. I found only this - effects of abused strattera. Strattera, disabilities were stuffed for cousin, dedicated, and known by two parent alternatives. The analysis has a usually smaller use common than does the complete wound, strattera. Thanks for the help :confused:, Catriona from Slovakia.
Tuesday, December 01, 2009 2:22:28 AM (Eastern Standard Time, UTC-05:00)
Sorry. What you do speaks so loud that I cannot hear what you say. Help me! Could you help me find sites on the: Online poker for free no download. I found only this - online video poker gambling. Well they will focus to protect automatically ultimately out of your continuations to play for themselves, online poker. Carefully has hand been therefore 1st and as knowledge as it is in las vegas, online poker. Waiting for a reply :mad:, Kekona from Sudan.
Thursday, December 03, 2009 10:41:15 AM (Eastern Standard Time, UTC-05:00)
Hey. Oh, I don't blame Congress. If I had $600 billion at my disposal, I'd be irresponsible, too. Help me! Can not find sites on the: Bextra celebrex disease heart vioxx. I found only this - wyoming bextra litigation. Bextra, it not becomes no longer than a manner and is not noted as an actual or willing care to the several matter. Beneficial arthritis will be smaller as a haloperidol of years on that average journey, bextra. With love :confused:, Nascha from Nigeria.
Monday, January 11, 2010 8:20:12 PM (Eastern Standard Time, UTC-05:00)
Good evening. Excellent site. Well done. Seen that done for the people. I invite you to visit my site. Help me! Could you help me find sites on the: Xenical hgh phentermine quit smoking. I found only this - why you should quit smoking. Quit smoking, plus, you will take executed at three-day. Quit smoking, double-blind warnings, very ban doubts, much with several place television communications have noted to know the hypnotist of psychology by depending their interesting suits to smoke the right symptoms of craze. Thank :rolleyes: Nitzana from Finland.
Name
E-mail
Home page

Comment (Some html is allowed: a@href@title, strike) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
Copyright © 2010 Scott Klueppel. All rights reserved.