Forums

write a code to upload photo to Facebook

kevinlam 18 Jan, 2012
Hi, I want to write a module that it can be upload some photos to facebook.
before the question, here is the background.
1. Joomla! 1.5.23, php 5.3.6, ChronoForms V3.1 RC5.2
2. custom a php program to get access to my facabook page by using facebook-php-sdk.
3. The php program divided into two parts that i) get authorization and ii) upload photos to FB page.

The question is why the same php program cannot get the valid authorization when run it in chronoforms? right now, the workaround solution is pre-run a separate php program to get valid authorization outside the joomla! and then run the same php program within chronoforms to upload photo.

BG,
Kevin Lam
GreyHead 18 Jan, 2012
Hi Kevin,

If the PHP runs outside ChronoForms then it will probably run inside ChronoForms. Other than that there isn't anything here to give any clues about the problem.

Bob
kevinlam 19 Jan, 2012
Hi Greyhead,

many thanks for your rapidly response. Yes, I believe chronoforms would treat any custom php code as usual without apply any limitation. I trust I am not the first to encounter this problem thats why raise up this question. I hope someone can share his experience, like you, on similar problem.

I bet, just guess, the problem is caused by joomla! "not allow" to get return from facebook. This kind of "not allowd", of course, is including generated by my poor programming skill.

According to your experience is it possible have any filtering or restriction applied by joomla! itself? or may be incorrect setting in facebook application? How do I run debugging environment with chronoforms so that I can raise up more specific question.

Cheers,
Kevin Lam
GreyHead 19 Jan, 2012
Hi Kevin,

I don't know anything about the FaceBook SDK. There is nothing I know of in Joomla! that would block the API.

Without specific code examples or error messages I can't say anything more that's useful.

Bob
kevinlam 20 Jan, 2012
thanks GreyHead,

I will try back to square one. hope can have good result in coming few day.

Cheers,
Kevin Lam
kevinlam 22 Jan, 2012
Hi GreyHead,

Finally, I found the way to put my custom php code to get auth. from facebook. it is because that facebook it will then redirect back to the url of the page where below function was called.

$loginUrl = $facebook->getLoginUrl();
header( 'location: ' .$loginUrl );

It will return error something like "...can't access this url", If I put these codes in "on sumbit code after sending email".

Now, I write php for user auth. in the "Main onLoad - Form html" and write php for photo upload in the "on sumbit code after sending email".

It is fine to me for this kind of arrangement, but just have little bit inconvenience is need your help. Where is the alternative to put my php code? so that not necessary rewrite again after perform form wizard.

Cheers,
Kevin Lam
This topic is locked and no more replies can be posted.