Uploading Files smoothly with Ajax on Facebook

Can you upload a file on Facebook using FBML and Ajax, not iframe? Just a simple input type="file" tag wrapped in a form and posted using Facebook's built-in Ajax. If so, how do you accept it on the server? I'm using Rails with Facebooker as my backend and Paperclip plugin for file uploads.

Thank you

Answer №1

While researching AJAX uploads, the only solution I came across involved utilizing iFrames. Does this mean that achieving AJAX uploads without iFrames is not possible?

Answer №2

what the client can do, the server can also do.

Answer №3

If you're working within a fbml app, there isn't a simple method to achieve this. However, one workaround is to create a standard file uploading script (non fbml) and direct your request to that script. The script will handle the upload process and then return you to the original fbml page.

I've successfully implemented this in the app below:

Check it out here: apps.facebook.com/theaffinity

Answer №4

Is there a way to implement a feature similar to Gmail's AJAX file uploader on a FBML page? Perhaps by using a hidden fb:iframe that posts directly to your server instead of Facebook's.

It seems like it might be a complex task, but if anyone has successfully done this, please share your insights!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

JavaScript Time and Date Formatting

I'm pretty new to programming, especially in Javascript. Can someone help me simplify my code? I'm trying to create a dropdown for months and an input field for the year. Is there a more efficient way to make the month select box? Also, how can ...

Is your Phonegap and Jquery app experiencing delays in script loading?

I recently developed a phonegap + JQM application and encountered an issue with the loading time of external JavaScript files. To elaborate, when the app starts, the initial file that appears is loader.html. In this file, I have included several JS files ...

Can you explain how to incorporate the ternary operator in a jQuery script that is part of an

Working with core PHP, jQuery, and MySQL, I have implemented 2 dependent dropdowns in my project. The first dropdown for the company list is populated directly from the database using a query on the same page. For the second dropdown containing the employ ...

Creating a multi-dimensional map object using JavaScript

Presented here is a data structure: tree = [ { "name": "Men Section", "categories": [ { "name": "Clothings", "Subcategories": [ { "name": "Jackets", "products": [ ...

Encountering an authentication failure error while making a call to a web method through the

Every time I attempt a JQuery call, I receive an Authentication failed message: { Message: "Authentication failed.", StackTrace: null, ExceptionType: "System.InvalidOperationException" } JQuery call being made: $(document).ready(function ( ...

Is there a way to determine what is affecting the properties of an element?

I've been grappling with a chunk of lengthy HTML, styles, and javascript. My mission? To uncover whatever magic is changing the text within a specific element. <span class="panel-title"> I'm a Panel with All Options</span> Transform ...

What is the best way to start up node.js and react?

Can you help me with running a server node js and a react app simultaneously? Here is my package.json { "name": "mon-app", "version": "0.1.0", "private": true, "dependencies": { "express": "^4.17.1", "react": "^16.14.0", "react-dom": ...

Ways to implement a placeholder height for images on a webpage with varying heights using HTML

I'm facing an issue with an image on my website that has a dynamic width and height as defined by the following CSS: .sm_item_image { width:100%; height:auto; max-width:400px; } The problem arises when the image takes some time to load, ...

How does Label work in ChartJS?

Hello there! I am currently in the process of developing a project that involves utilizing an API. This API has data with various dates included. My goal is to create a function within the labels that includes all the necessary dates for the API. Can you ...

What causes a component to not update when it is connected to an Array using v-model?

Array1 https://i.stack.imgur.com/cY0XR.jpg Array are both connected to the same Array variable using v-model. However, when changes are made to Array1, Array2 does not update. Why is this happening? Process: Upon examining the logs, it can be observed th ...

Adjust Leaflet map size when the containing element is resized (Dash Plotly)

I am encountering some difficulties with dash-leaflet, particularly regarding its width when the parent container is resized. I am utilizing dash-resizable-panels to resize certain divs. Allow me to present a Minimal Reproducible Example (MRE) below: # pi ...

Using JQuery to toggle the activation and deactivation of a click event

There are various HTML elements included below: <p class="accordion-header open" id="platform_0" onclick="validateScreens(this)">Platform 0</p> <p class="accordion-header open" id="platform_1" onclick="validateScreens(this)">Platform 0&l ...

Guide on generating a dynamic loop in JavaScript using the group name as a variable

I have been attempting to organize a group, dynamically ungroup it, and then create a loop with each element of the group. Despite reviewing multiple examples, I have not been able to solve the following issue: The grouping is done based on the "tipo" pro ...

Combining strings in JavaScript using the shorthand for plural or singular terms

$scope.message = 'Alright, you devoured ' + number + ' taco' + (number.length > 1) ? 's' : '' + ', understood!'; Why does the $scope.message above only display 's'? I was anticipating t ...

Creating a Two-Dimensional Drawing Platform with Three.js

I am looking to develop an interactive whiteboard specifically for AltspaceVR. As someone who is just beginning with Three.js, I am curious about how to go about creating a 2D canvas that allows for drawing. Any guidance on this would be greatly apprecia ...

Adding days to a HijriDate: A step-by-step guide

I need help with two text boxes. The first box is for selecting the StartDate from an Islamic calendar, which I am currently using jQuery Calendars Datepicker for. The second textbox, ExpireDate, should automatically be set to 60 days after the selected St ...

I'm feeling stuck trying to iterate through this array, especially when the console keeps saying it's actually an object

As I embark on a personal project to fetch and display information from Reddit, I find myself confused by an error that keeps popping up. There are two main points of confusion for me. The issue arises when the page fails to render due to the message ...

Creating a clone of a JavaScript object based on an already existing JavaScript object

Can someone help me with this coding issue? var originalObject = { method1: function() { // Do something }, method2: ['a','b','c'], method3: 1234 } I am trying to create a new object based on the orig ...

Sending output from javascript back to html

<head> function displayProductName(name) { } </head> <body> <img src="...images/car.jpg" onclick="displayProductName('car')"> </body> How can I modify this javascript function to display the value received from t ...

Issues with the functionality of apostrophes and commas in an alert box, specifically in a confirmation box

I have been developing a PHP script for managing karaoke events. Once the user submits a search term, the script displays the available songs from the database. The user can then click on a song title to add it to a queue. This "queue" data is stored in a ...