tags:

views:

387

answers:

2

Hi

I want to create a page in my facebook app which lets user upload an image from their system. How can I do this? The image will be stored on my server and not in the user's photos.

Thanks.

A: 

there are many languages that do the functionality your requesting, I would suggest PHP since FB runs on that. A quick Google Search should pull up all the info and code you might need to complete the image upload as you have requested, but just in case here is a simple tutorial. Also you will need to create the FB app which they offer a great API and resources.

Phill Pafford
A: 


<form action="action.php"
enctype="multipart/form-data" method="post">
<p>
Type some text (if you like):<br>
<input type="text" name="textline" size="30" />
</p>
<p>
Please specify a file, or a set of files:<br>
<input type="file" name="datafile" size="40" />
</p>
<div>
<input type="submit" value="Send" />
</div>
</form>

In action.php:


if ($_FILES["datafile"]["error"] > 0)
{
  echo "Error: " . $_FILES["file"]["error"];
}
else
{
  echo "Upload: " . $_FILES["datafile"]["name"];
  echo "Type: " . $_FILES["datafile"]["type"];
  echo "Size: " . ($_FILES["datafile"]["size"] / 1024) . " Kb";
  echo "Stored in: " . $_FILES["datafile"]["tmp_name"];
}
Pierre-Antoine LaFayette
I doubt that this generic upload code helps the original poster in any way.
cvk