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

  • Home
  • SEARCH
  • 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 9223183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:00:57+00:00 2026-06-18T04:00:57+00:00

I am trying to send an attachment with my email programmatically. The attachment is

  • 0

I am trying to send an attachment with my email programmatically. The attachment is my db file. I was able to get it done when the DB file is on the SD card.However when it is internal then it keeps complaining that the file is not found

Here is my code:

    String path = "/data/data/MyPackageName/databases/mydb.db"
    Intent email = new Intent(android.content.Intent.ACTION_SEND);

    email.setType("plain/text");
    email.putExtra(android.content.Intent.EXTRA_SUBJECT, title);
    email.putExtra(android.content.Intent.EXTRA_TEXT, "Hiii");

    email.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://" + path));

Any idea why it does not work in this path? Am I missing something or does attachment works for files on external storage only?

  • 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-18T04:00:58+00:00Added an answer on June 18, 2026 at 4:00 am

    That’s correct behavior. The file is in your application’s private storage, and can not be accessed by any other process. You either need to copy it to external storage first, or implement a content-provider to pass on a file descriptor for it.

    Refer to this project for an excellent example of how to implement a ContentProvider for files.

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

Sidebar

Related Questions

I'm trying to send an email with an attachment using CakePHP 2.0. The file
I am trying to send an email that contains an attachment (a pdf file)
I am trying to send an email containing a file attachment created by the
Trying to get Play! Framework to send an email with an attachment. Code below
I'm having some trouble trying to get my script to send a file attachment
I'm trying to send a file as an email attachment, but for some reason
I'm trying to send an encrypted email with an attachment from PHP, however, my
I am trying to send an attachment through AWS Simple Email Service, and i
I have been trying to get php to send a email with a attached
Having big problems trying to get my php script to send email. Using this

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.