![]() |
Saving Images
I am working on a script that would allow users to press a button and send a photo to Facebook, similar to Classic iPhone's and Era iPhones.
I know I have to use the Facebook API to handle the data, but how would I even send a photo from a GServer to an external server? |
Load the image:
temp.photo.loadstring("path/to/photo.jpg"); POST the image to the server: http://forums.graalonline.com/forums...hp?t=134265118 |
Would this send the plain image? or base64?
|
Whatever format the image is in.
|
Thanks!
One last question, do you happen to know how to upload a photo to Facebook via a PHP script? It sais I need the cURL extension installed but my host doesn't allow cURL unless I pay. So I'm at a dead end. Also say I have a PHP script which gives photo's random names and uploads, is it possible to then send data back to Graal? |
You don't need to go through your own web-server, the above POSTing method uses cURL.
|
Yes but the way Facebook's API works it needs to gain an access token before it can upload a photo.
Anyway, is there a way to send data to a server; say for instance I want to make a page where you can submit a .txt file, and then view all text files from Graal. How would you go about sending data backwards and forwards? I am eventually going to make it so you can upload images to a website, head's etc then view them on Graal. |
You have to use TSockets, or polling with curl requests or requesturl.
Try creating a web application using Ruby and the Sinatra framework (or other similar frameworks) to get a better understanding of how GET and POST works. |
I understand how GET works.
It adds information to the url, eg if you wanted to send a variable named derp and on the page you had a textbox with the name derp it would be like this. http://www.url.com?derp=whatever&other=other Then you use this in php to get it. $derp = $_GET['derp']; The only one I don't undertand of the two is POST. I'll have to do some research :D |
POST is basically the same thing as GET but it doesn't show in the url, so one could say it's 'more secure'.
|
Yes I know, but how it sends the data I want to find out.
With GET it just extracts the information from the URL. Where as POST doesn't send any extra data in the URL so I wanted to find out how it actually sends the data. |
Quote:
|
| All times are GMT +2. The time now is 07:04 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.