Top VPS Hosting Provider

Welcome to the myhosting.com Forums.
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    ancient1 is offline Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Default upload asp on the cloud

    I've used the upload asp on the classic hosting / older server. Now on the 2008 Windows Server (cloud) and the old script no longer works.
    Can someone direct me to the asp code so visitors can upload files to me?
    There should be two sections: HTML and ASP.
    Thanks for the help.

  2. #2
    jeremya is offline Administrator
    Join Date
    Jun 2008
    Posts
    270

    Default

    the asp code provided is particularly for windows server 2003 environments. On 2008 we provide an asp.net script.

    http://myhosting.com/wiki/ASP.NET_Upload

    Upload that as a .aspx file to your site space, create a subfolder called uploads and give that uploads folder full write permissions (you can do this using the File Manager in your onCloud control panel).
    -Jeremya

  3. #3
    ancient1 is offline Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Default

    jeremya,

    Thank you for the reply. I'll try that later today or tomorrow morning and let you know how it works for me ... either success or more questions.
    Regards.

  4. #4
    ancient1 is offline Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Default

    Jeremya,
    Maybe I should change my name to "In over my head" ...

    I tried the script and received a server error.

    My site is not a sub-site but does reside inside my main site, like a sub-site.
    Do I need to change anything in this line:
    postedFile.SaveAs(Server.MapPath("~") & "uploads\" & filename)

    I did create the uploads folder and set the permissions to write.

    You have no idea how much a appreciate your help.
    regards

  5. #5
    jeremya is offline Administrator
    Join Date
    Jun 2008
    Posts
    270

    Default

    you mean the page is located in a subfolder? If so then you just need to include that path in the saveAs line and make sure your uploads folder is in the correct location aswell.

    So if your site is at -http://yourSite.com/subfolder/- then you would need to make sure the uploads folder is created underneath the subfolder at -http://yourSite.com/subfolder/uploads/-.

    Then, the saveAs line should read:

    postedFile.SaveAs(Server.MapPath("~") & "subfolder\uploads\" & filename)

    then it should work just fine
    -Jeremya

  6. #6
    ancient1 is offline Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Default It's working

    Hi Jerermya,

    Couldn't get it to work in the secondary site, but was able to make it work just fine in the parent folder.

    Now that I know it works for me, I can continue with my project.

    Is there a way to have it accept multiple files ... say up to 3.

    thanks ever so much.

  7. #7
    jeremya is offline Administrator
    Join Date
    Jun 2008
    Posts
    270

    Default

    everything's pretty hard coded, probably wouldn't take too much effort but here's a pretty good video tutorial which may help.

    [How Do I:] Multiple File Uploads in ASP.NET*2: The Official Microsoft ASP.NET Site
    -Jeremya

  8. #8
    ancient1 is offline Junior Member
    Join Date
    Aug 2010
    Posts
    5

    Default All is good...

    Jeremya,
    With the info and help you gave me, I've got things working.
    Now I need to learn a more about asp.net

    Thank you very much.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts