Jump to:

10931 Posts in 2614 Topics by 1810 members

All other Modules

SilverStripe Forums » All other Modules » Debugging Uploadify S3UploadField::uploads3()

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1 2 3
Go to End
Author Topic: 2559 Views
  • otherjohn
    Avatar
    Community Member
    125 Posts

    Debugging Uploadify S3UploadField::uploads3() Link to this post

    Hi Cheese!

    Ok, I get the HTTP Error on error. And to debug it, I have put die("hello"); in the first line of "public function uploads3() "
    BUT, it still gives me the "HTTP ERROR". I am kinda lost on where to check next. This is just a test page to make sure the S3 is working.
    Any idea on how I can debug this further?

    --changed the name of my buckets and auth codes below.

    Here is my code
    in uploadify folder _config I have

    <?php
    S3File::set_auth("xxxxxxxxxx", "xxxxxxxxxxx");
    S3File::set_default_bucket('media.mydomain.com');
    Director::addRules(10, array(
       UploadifyUploader::$url_segment => 'UploadifyUploader'
    ));

    and my test page code has:
    <?php
    class TestPage extends Page {

       public static $db = array(
          );

       public static $has_one = array(
          'S3Test' => 'S3File'
       );
    public function getCMSFields() {
          $f = parent::getCMSFields();
          $f->addFieldToTab("Root.Content.S3 Storage", $s3 = new S3UploadField('S3Test','Send a file to Amazon S3'));
    $s3->setVar('s3bucket', 'media.mydomain.com');
          return $f;
       }
    }
       
    class TestPage_Controller extends Page_Controller {
       public static $allowed_actions = array ();
       public function init() {
          parent::init();
       }
    }

  • UncleCheese
    Avatar
    4085 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    You can go to S3Uploadfield.php::uploads3() and put die('hello') statements at various places in the function to see what line is causing the error.

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    Yeh I did that,

    ---public function uploads3() {
          die('hello');

    but it doesnt throw the error. Not sure why?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    At first glance, this doesn't look like a valid bucket name "media.mydomain.com"

    Are you sure about that one?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    Sorry, I missed that in your initial post. Did you put that in S3UploadField.php or S3Uploader.php?

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    Yeh, media.mydomain.com is a valid bucket. I have used it with other apps and uploaded to it. Its how you do a s3 cname setup.

    S3UploadField.php

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    Just tried also S3Uploader.php but its still the same, not catching the die() in the first line of uploads3

    Oddly enough, it appears to be uploading (progress bar goes up to 100%, then throws its http error.
    John

  • otherjohn
    Avatar
    Community Member
    125 Posts

    Re: Debugging Uploadify S3UploadField::uploads3() Link to this post

    I also changed the bucket to one of my regular named buckets and it's still doing the same thing.
    John

    2559 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.