What are the steps to save an image to the iOS photo gallery using PhoneGap?

I am facing an issue with downloading pictures using phonegap cordova 2.1 and displaying them in the gallery of an Apple iPhone or iPad. I have implemented the following JavaScript function:

$("#btnDL").click(function(){
    var file = $("#imgViewer img").attr('src');
    var aux =file.split('/');
    var fName = aux[aux.length - 1];

    var fileTransfer = new FileTransfer();

    fileTransfer.download(encodeURI(file),"/var/mobile/Applications/9A25FA0A-49A9-4DED-BD83-5FF043A9075/Document/MyApplicationName",function(entry){
        alert("Image saved in "+entry.fullPath);
    },function(error){
        alert("ERR: "+JSON.stringify(error));
    });
});

The function indicates that the file was saved on my iPad. However, when I check the gallery, the picture is not there. I have considered creating a plugin in objective-C, but my knowledge of this language is limited. I have also tried to use the following plugins:

and

https://github.com/aaronksaunders/FileDownLoadApp

Unfortunately, they did not yield the desired results.

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

Can you explain the distinction between String[] and [String] in TypeScript?

Can you explain the distinction between String[] and [String] in typescript? Which option would be more advantageous to use? ...

Library for JavaScript coding within a textarea element, complete with correct indentation

Seeking a JavaScript library for coding in a textarea with proper indentation. Came across Behave.js () which lacks the basic feature of indenting a new line based on the last lines indent. It only auto-indents by recognizing braces and parentheses. Codem ...

The Flux Router in React Native

I am diving into the world of React Native and currently working on creating a practice app. The issue I'm facing is with the routing functionality in my project. At the moment, I have three main components: the app itself, the router component, and o ...

Show a random number within a Bootstrap tooltip

I am trying to make a bootstrap popover display a random number every time it is clicked, but my current implementation is only showing the initial number generated and does not update on subsequent clicks. Below is my code snippet: <button type=&qu ...

What is the best way to modify the identifiers of the elements in the 2D matrix using JavaScript?

Hello, I've been working on a program that allows users to add or delete nodes at any index within a 2D array. However, I'm currently only able to retrieve the index of the clicked element, not all of them. How can I manipulate the IDs of this 2D ...

Tips on creating a subsequent post for a file that has been uploaded to a Node Express server and then forwarded to a different API

We are currently working with an Express server in Node, where we upload a file on one route and then need to send this file to another endpoint for processing. However, the file is not stored locally on the server; it exists as an uploaded object. I&apos ...

Arrange the HTML DOM elements in the order of their appearance in a list

Is it possible to rearrange the order of <div> and its elements based on database information? For example, consider the following HTML structure: <div id="container"> <div id="A"> Form elements for A</div> <div id="B"& ...

The use of Selenium Actions moveToElement is not functioning properly on Google Chrome 75.0.3770.80 running on an Ubuntu system

After selecting an element, I attempted to physically move the mouse cursor over it. I tried using the Actions class provided with Selenium and the method I used is moveToElement(). Actions actions = new Actions(driver); actions.moveToElement(element).bu ...

Using Jquery to implement multi-step forms with real-time ajax confirmation

Good day, I am encountering an issue with my code. In essence, what I am attempting to do is validate the database connection and if successful proceed to the next step, otherwise remain on the same step and display an alert. However, even when the connect ...

What is the best way to locate elements with the term "download" in them using Selenium's x-path feature?

I'm currently utilizing Selenium for web scraping purposes and I am in need of a way to identify all clickable elements that contain the word "download" (regardless of capitalization) within their link text, button text, element ID, element class, or ...

Error E11000 occurred in MongoDB due to a duplicate ID key being detected, resulting

In the process of developing a todos application using the MERN stack, I encountered an issue while attempting to implement personal todos for individual users: MongoServerError: E11000 duplicate key error collection: Todos-APP.todos index: _id_ dup key: { ...

Guide to building a nested React component

My custom dropdown component requires 2 props: trigger (to activate the dropdown) list (content to display in the dropdown) Below is the implementation of my component: import { useLayer } from "react-laag"; import { ReactElement, useState } fr ...

How can I log an object definition and text in the same console.log statement?

Looking for a way to correctly display "obj" in the same string as "note." Here's my JavaScript code: console.log(obj);// [query: "wordOfTheDay"] console.log(note + " : " + obj ); // obj does not show up I want to ensure that "obj" displays properly ...

NextJS will redirect the user back to the previous router they came from following authentication

Hello! I am currently facing a challenge in redirecting a user back to the initial page they clicked on after being authenticated. The issue lies in server-side rendering (SSR) and the lack of access to the window.history object in getServerSideProps. The ...

What is the reason for xhr.response being set to null whenever there is a warning in my PHP code?

In order to clarify, it's important to note that the .php files belong to my professor and should not be altered. The issue arises from the fact that $VALORES on line 186 is uninitialized, and I have already reported this to my professor. Below is th ...

Resource not found despite the existence of the resource identifier

I have encountered a problem while developing an app that retrieves data from JSON. The issue arises when attempting to convert an image from a string to an ImageView, resulting in the following error: E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #2 ...

Populate select2 with the selected value from select1 without the need to refresh the page or click a button

Being a novice in PHP and Javascript, I am looking for a way to populate the "info" select dropdown based on the selected value from the "peoplesnames" dropdown without refreshing the page or using a button. Here's my code: HTML: <select id="peo ...

Tips for sending JSON data through Parse Push Notification

I need to send JSON data for Parse Push notification with the following format: { "action": "android.intent.action.PUSH_STATE", "alert": "welcome", "message": "123123,123,123" } This is the code I am currently using: NSDictionary * postDicti ...

Exploring the powerful trio of Node.js, MySQL, and asynchronous iterative functions

Currently grappling with an iterative function in nodejs. I'm traversing through an object and checking for any attached sub-objects (imagine a star having a planet with a moon that has an orbital station with a ship). The aim is to construct an arr ...

Updating REST API: Sending a PUT request without requiring all data to be included in json format

I have a controller set up for updating user data. The controller can accept up to 4 values. I am wondering if it is possible to only update the name field when sending data to this route, leaving the rest of the fields unchanged (and not empty). Should ...