Html-Post Facebook, Html-Post Facebook |
Html-Post Facebook, Html-Post Facebook |
Arimle |
Nov 25 2020, 03:32 AM
Post
#1
|
Group: Members Posts: 3 Joined: 25-November 20 Member No.: 27,653 |
I have an html file that selects a file from the user's computer
CODE <html> <body> <form enctype="multipart/form-data" action="http://localhost/uploader/upload.php" method="POST"> Please choose a photo: <input name="source" type="file"><br/><br/> Say something about this photo: <input name="message" type="text" value=""><br/><br/> <input type="submit" value="Upload"/><br/> </form> </body> </html> When I click the download button, I need to upload this file to Facebook and share this file. On the Internet I found the following code. I'm very little familiar with PHP, but I think this code is closer to my task. CODE <?php //upload.php if(isset($_FILES['photo']) && isset($_POST['message'])){ $uploadfile = './uploads/'.basename($_FILES['photo']['name']); $iStats=getimagesize($_FILES['photo']['tmp_name']); if (isset($iStats['mime']) && $iStats[0]>0) { move_uploaded_file($_FILES['photo']['tmp_name'], $uploadfile); include_once 'fbmain.php'; try{ $uid = $facebook->getUser(); $me = $facebook->api('/me'); $token = $session['access_token'];//here I get the token from the $session array $album_id = '2179901265385';//MY ALBUM ID $facebook->setFileUploadSupport(true); $args = array('message' => $_POST['message']); $args['image'] = '@' . realpath($uploadfile); $data = $facebook->api('/'. $album_id . '/photos?access_token='. $token, 'post', $args); } catch(FacebookApiException $e){ echo "Error:" .$e; } unlink($uploadfile); echo "Success!\n"; } else { echo "Wrong file type!\n"; } } ?> Please help me, what needs to be changed in the code in order to transfer the selected file to Facebook and share this file? Attached File(s) FB1.HTML ( 1.49k ) Number of downloads: 3632 |
pandy |
Nov 25 2020, 03:37 AM
Post
#2
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,763 Joined: 9-August 06 Member No.: 6 |
I don't understand. What download button? What are you trying to do?
Regarding the PHP script, I doubt very much that you can use PHP or any server side language at all at Facebook. Can you even use HTML? I don't think so. |
Arimle |
Nov 25 2020, 03:50 AM
Post
#3
|
Group: Members Posts: 3 Joined: 25-November 20 Member No.: 27,653 |
I don't understand. What download button? What are you trying to do? Regarding the PHP script, I doubt very much that you can use PHP or any server side language at all at Facebook. Can you even use HTML? I don't think so. I want to upload a selected file to Facebook and share it. I can use HTML. But can not use PHP. |
pandy |
Nov 25 2020, 04:59 AM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,763 Joined: 9-August 06 Member No.: 6 |
OK. I didn't know you were allowed to use *anything* there. But if FB allows file sharing, don't they already have a function for that?
Sorry, but I don't use FB, so I'm afraid I can't help very much. |
Arimle |
Nov 25 2020, 05:20 AM
Post
#5
|
Group: Members Posts: 3 Joined: 25-November 20 Member No.: 27,653 |
|
pandy |
Nov 25 2020, 05:21 AM
Post
#6
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,763 Joined: 9-August 06 Member No.: 6 |
No idea. I wouldn't have thought it could be done on any of those services. I don't use insta either.
|
TitianAnna |
Jun 2 2022, 08:55 PM
Post
#7
|
Group: Members Posts: 2 Joined: 2-June 22 Member No.: 28,373 |
I have posted personal photos that I have edited on instagram and other social networking sites but the likes are negligible even though my friends and followers are quite a lot. Please share
|
pandy |
Jun 2 2022, 10:36 PM
Post
#8
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,763 Joined: 9-August 06 Member No.: 6 |
Tough luck.
|
TitianAnna |
Jun 4 2022, 04:21 AM
Post
#9
|
Group: Members Posts: 2 Joined: 2-June 22 Member No.: 28,373 |
I came back here because Followergir APK https://techzapk.com/followergir.htm is a useful use for instagram
|
pandy |
Jun 4 2022, 05:47 AM
Post
#10
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,763 Joined: 9-August 06 Member No.: 6 |
So that solved your problem?
|
Lo-Fi Version | Time is now: 10th November 2024 - 12:54 PM |