Struggling With S3 Download Links. Can Anyone Help?

by Millie
11 replies
Hi Warriors,

I’ve uploaded some files to my Amazon S3 account and have written some download links which take the following format:

http://bucket.s3.amazonaws.com/folder.zip

When I click to download I get the following error message:

“This XML file does not appear to have any style information associated with it. The document tree is shown below.”

Followed by the error code telling access denied.

Does anyone know what I need to change to get the download links to work?

Thanks

Amanda
#download #links #struggling
  • Profile picture of the author Nics
    Did you make the file public?
    Signature
    List Building Demystified --> http://internetpoweredincome.com
    {{ DiscussionBoard.errors[6678436].message }}
  • Profile picture of the author Terry Kyle
    Originally Posted by Millie View Post

    Hi Warriors,

    I've uploaded some files to my Amazon S3 account and have written some download links which take the following format:

    http://bucket.s3.amazonaws.com/folder.zip

    When I click to download I get the following error message:

    "This XML file does not appear to have any style information associated with it. The document tree is shown below."

    Followed by the error code telling access denied.

    Does anyone know what I need to change to get the download links to work?

    Thanks

    Amanda
    Hi Millie,

    Sounds like you need to edit your ACL settings to allow public access (Everyone to view).

    I use 2 free tools to manage my S3 account (without which it would be a nightmare):

    S3Fox Organizer(S3Fox)

    and

    S3 Software | Free Amazon S3 Browser For Windows - CloudBerry Lab
    {{ DiscussionBoard.errors[6678496].message }}
  • Profile picture of the author AndrewStark
    You will need to make the files public via the ACL, and the firefox S3 plugin is awesome for this.

    Now the trouble is that by making the file public the link can be shared.

    I'm just setting up my site with the fast member plugin that I bought as a WSO and it has protection build into the membership site. Not sure how you would protect without this, but it will have something to do with the secret key code.
    {{ DiscussionBoard.errors[6679010].message }}
    • Profile picture of the author Millie
      Thanks for the replies, but I’m still having no joy.

      I’m using CloudBerry Explorer for Amazon S3 (CloudBerry Lab), and have the ACL settings set to everything for me and Read and Read ACP for all users.

      I thought this would allow the files to be downloaded, but the links wouldn’t be protected.

      I have the Rapid Crush S3 Flowshield plugin to protect links in a Wordpress site, but this is an html page, which I believe needs some additional php code to protect the links.

      If I can get the files to download, I can ask a coder to code. But I’m still unable to download.

      Anyone any suggestions?

      Thanks

      Amanda
      {{ DiscussionBoard.errors[6679431].message }}
      • Profile picture of the author ksmusselman
        Originally Posted by Millie View Post

        Thanks for the replies, but I'm still having no joy.

        I'm using CloudBerry Explorer for Amazon S3 (CloudBerry Lab), and have the ACL settings set to everything for me and Read and Read ACP for all users.

        I thought this would allow the files to be downloaded, but the links wouldn't be protected.

        I have the Rapid Crush S3 Flowshield plugin to protect links in a Wordpress site, but this is an html page, which I believe needs some additional php code to protect the links.

        If I can get the files to download, I can ask a coder to code. But I'm still unable to download.

        Anyone any suggestions?

        Thanks

        Amanda
        Oh, I'm sorry. I hope someone here can help. That's quite a bit beyond my expertise. :confused:
        Signature
        Do You Vape? Submit a Guest Post! SmokersLogicEcigs.com
        Info Blog about Ecigs & Personal Vaporizers
        {{ DiscussionBoard.errors[6679448].message }}
      • Profile picture of the author joseph7384
        [DELETED]
        {{ DiscussionBoard.errors[6679984].message }}
        • Profile picture of the author WillR
          Originally Posted by joseph7384 View Post

          First off everyone thinks that you need to set permissions to read, that is not secure as anyone that knows a little bit of coding can add code to the javascript and view your content.

          You should always disable read and you want to go to your DNS and add a cname to your domain and append S3amazon.com to it, but you still need to protect your content by either adding some additional .PHP code for static html or for wordpress use a plug-in called Flowshield which you have stated that you have.

          I just want to ask why you prefer static html over wordpress in anycase you need this additional php code.



          PHP CODE:

          Top of .php file

          </php
          ='ACCESS_KEY_ID';
          ='SECRET_ACCESS_KEY';
          require_once'S3.php';
          = new S3("", "");
          ?>

          Where you need the link
          <?php echo ("BUCKET", "FILE", EXPIRE_TIME); ?>




          Of course your going to copy & paste your info in the proper locations such as the access key id, secret access key and you will need to ad a value to the EXPIRE_TIME.

          Also for unprotected content you should use Cloudfront which is a content delivery service which will speed up your site by delivering video, images or free pdf's from their servers.
          I just want to point out that when using the php code above, your page name does need to end in .php.

          I know the poster above sort of put that at the top but it's an important point. If the page is not a.php file then the php code will not work.

          Put all your files as private and then use that code above to protect the download links.
          {{ DiscussionBoard.errors[6680059].message }}
          • Profile picture of the author joseph7384
            [DELETED]
            {{ DiscussionBoard.errors[6680207].message }}
            • Profile picture of the author Millie
              I’m having a nightmare! I must be so close, yet still can’t get it:-(

              Joseph/Will, I appreciate your help. Below is what I’ve done, but I’m still having no joy. Would you mind taking a look and see if you can find the error?

              To answer Joseph’s question, I have a blog which has been created in Wordpress. I’m promoting some reseller rights products which have html sales sites. I’m setting up each sales site in a sub-directory of my domain name. I don’t want to include the sales sites as part of my blog because the graphics are different and I don’t want my blog widgets on my sales sites.

              The notes I’m working through say I can use php code in a html document if I add the following code to the top of the .htaccess file (assuming Apache web server),

              AddHandler application/xhttpdphp htm html

              I’m using Hostgator, which I believe is Apache, but when I add the code I get a 500 Internal Server Error.

              As I can’t get the above to work, I’m renaming the files with a php extension. I’ve downloaded the s3.php code from http://undesigned.org.za/2007/10/22/amazons3phpclass and put in the same directory as the download pages on my Hostgator account, not in my Amazon bucket.

              I’ve added the following code to my web page. I’ve put it above the html tag.

              <?php
              $S3AWSID='ACCESS_KEY_ID';
              $S3AWSSECRET='SECRET_ACCESS_KEY';
              require_once 'S3.php';
              $s3 = new S3("$S3AWSID", "$S3AWSSECRET");
              ?>

              I’ve entered my keys, keeping the single quotes.

              The code I’m using for my download link is,

              <a href="<?php echo $s3>getAuthenticatedURL("BUCKET" , "FILE", EXPIRE_TIME) ?>" target="_blank">Click To Download</a><br>

              When I replace the bucket and file names, I do not include them in quotes.

              When I click on the link I get a Page Not Found error. If I right click on the link, it wants to save the html document.

              I am using a CName. The name is BUCKET, the record is BUCKET.s3.amazonaws.com

              Thanks

              Amanda
              {{ DiscussionBoard.errors[6696019].message }}
  • Profile picture of the author MaxPowers
    S3 uses XML to notify you that the permissions do not allow the file to be downloaded. Quite simply, they do not use an XML Stylesheet (a .xsl file) with their XML error messages and this explains both error messages you see.

    You can also look up "Expiring URLs" for S3, which you can generate via script. This will deny people after whatever timeframe you setup, but a new URL will need to be generated each time you hand it out.

    Once your files are downloaded, people can rip you off and upload the actual file.zip, but the links you give out will not allow download after the time period you define in your expiring links.

    This can be tough for non-techs to create, but it gives you a direction to look if you want to somewhat protect your files.
    {{ DiscussionBoard.errors[6679265].message }}
    • Profile picture of the author ksmusselman
      Right click on the file, on the pop-up window click on Make Public.

      Done.

      I had the same error when I first started using S3 and that's all I had to do. After I uploaded the file, I right clicked on it and clicked on Make Public.
      Signature
      Do You Vape? Submit a Guest Post! SmokersLogicEcigs.com
      Info Blog about Ecigs & Personal Vaporizers
      {{ DiscussionBoard.errors[6679304].message }}

Trending Topics