How do I upload files to a Classic ASP website on Cloud Sites?
In order to do this 2 pieces of information are required.
- The data center location of the website ( ORD or DFW ) ( If website test link contains 'dfw' the site is assigned to DFW, otherwise it is ORD)
- The web directory into which the files are uploaded. This is obtained from the features tab and would look like \\fs1-n01\stor1wc1dfw1\300000\asp.example.com\web\content\upload
Once the information is available use the following 2 asp files as references to upload files. The USERNAME and PASSWORD in UploadScript1.asp are the same as those used for impersonation. (Refer to How do I add impersonation to my ASP.NET site?)
<HTML> <BODY BGCOLOR="#FFFFFF"> <FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="UploadScript1.asp"> <INPUT TYPE=FILE SIZE=60 NAME="FILE1"><BR> <INPUT TYPE=FILE SIZE=60 NAME="FILE2"><BR> <INPUT TYPE=FILE SIZE=60 NAME="FILE3"><BR> <INPUT TYPE=SUBMIT VALUE="Upload!"> </FORM> </BODY> </HTML>
<HTML> <BODY> <% Set Upload = Server.CreateObject("Persits.Upload.1") Upload.LogonUser "ord", "USERNAME", "PASSWORD" Count = Upload.Save("\\fsvs02\target02\WindowsPathInFeaturesTab\upload") %> <% = Count %> files uploaded. </BODY> </HTML>
Please note that if your Cloud Site is located in the DFW datacenter the Upload.LogonUser line would need to be altered as follows:
Upload.LogonUser "dfw", "USERNAME", "PASSWORD"
Please also note that the credentials you use here must be those of the Primary FTP account. Secondary FTP accounts will NOT work!
© 2011-2013 Rackspace US, Inc.
Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License
See license specifics and DISCLAIMER