Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8832463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:32:09+00:00 2026-06-14T08:32:09+00:00

Using PhoneGap is it possible to get the mime type of a file in

  • 0

Using PhoneGap is it possible to get the mime type of a file in the local file system?

Part of my app downloads a file from a remote URL on our server and saves it to the Android downloads folder. I then use the WebIntent plugin to open the file but one of the options this requires is a mime type.

I’ve not been able to find anything in API Documentation or Google other than here, but that is more relevant to forms.

Has anyone tried to do this before?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T08:32:10+00:00Added an answer on June 14, 2026 at 8:32 am

    Something like this would work on Android but YMMV on other platforms:

    var medFile = new MediaFile("empty.txt", "file:///mnt/sdcard/empty.txt");
    console.log("file path = " + medFile.fullPath);
    medFile.getFormatData(function(metadata) {
        console.log("mimeType = " + metadata.type);
    }, function() {
        console.log("fail");
    });
    

    metadata.type would be your mime type.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a PhoneGap app for Android. To get data from the (remote) server
Is it possible to launch one app from another using Phonegap? We want to
I'm using PhoneGap and JavaScript to produce an iPhone app. Is it possible to
Is it possible to protect sqlite database inside mobile app created using PhoneGap +
Is it possible to create Phonegap APP´s without using Eclipse, but using like Notepad++
I am building a Android HTML5 App using phonegap - Is it possible to
I am using Phonegap file upload to upload SVG files to my server. It's
I am using phonegap file api to create a directory and create a file
I'm using Phonegap (Cordova) v1.9, and this app is solely for iPhone4+ use. I've
I'm using PhoneGap to develop a Windows Phone 7 app. I'm trying to call

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.