Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

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

Debugging Uploadify S3UploadField::uploads3()


Go to End


24 Posts   3840 Views

Avatar
otherjohn

Community Member, 125 Posts

31 August 2010 at 2:44am

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();
}
}

Avatar
UncleCheese

Forum Moderator, 4102 Posts

31 August 2010 at 3:21am

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.

Avatar
otherjohn

Community Member, 125 Posts

31 August 2010 at 3:22am

Yeh I did that,

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

but it doesnt throw the error. Not sure why?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

31 August 2010 at 3:22am

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

Are you sure about that one?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

31 August 2010 at 3:23am

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

Avatar
otherjohn

Community Member, 125 Posts

31 August 2010 at 3:25am

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

Avatar
otherjohn

Community Member, 125 Posts

31 August 2010 at 3:27am

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

Avatar
otherjohn

Community Member, 125 Posts

31 August 2010 at 3:28am

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

Go to Top