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 6227671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:15:46+00:00 2026-05-24T09:15:46+00:00

I want to upload a file which is stored in sdcard to php server.To

  • 0

I want to upload a file which is stored in sdcard to php server.To upload a file i need the filepath.When i am giving the path in application my file is getting uploaded to php server.For this i have used code from following url Android file uploader with server-side php and it working nice.But here the path is given in source code only.But i donot want to give the path in my application.I want to open the sdcard and then select the file which i want to upload at run time.so my question is how to get the filepath of pdf at run time on selecting pdf file from sdcard so that i can use the path to upload that file. thank you

  • 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-05-24T09:15:46+00:00Added an answer on May 24, 2026 at 9:15 am

    this is what i use to get video files. you can change them for pdf.

    private static final int SELECT_VIDEO_DIALOG = 1;
    

    …

    Intent intent = new Intent();
    intent.setType("video/*");
    intent.setAction(Intent.ACTION_GET_CONTENT);
    startActivityForResult(Intent.createChooser(intent, "Select Video"), SELECT_VIDEO_DIALOG);
    

    and in your onActivityResult

        public void onActivityResult(int requestCode, int resultCode, Intent result) {
        if (resultCode == RESULT_OK) {
            if (requestCode == SELECT_VIDEO) {
                Uri data = result.getData();
    
                if(data.getLastPathSegment().endsWith("mp4")){
                    Player.show(this, data);    
                } else {
                    Toast.makeText(this, "Invalid file type", Toast.LENGTH_SHORT).show();   
                }               
            }
        }
    }
    

    this will open file manager applicatons like FileEexpert, astro, Gallery … and you can browse and select the file.

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

Sidebar

Related Questions

In my application I want to upload file from SD card to my server.
I want to upload a file to a ftp server programmatically (C++). If the
i want to upload the sound file (.ogg) in server. But it should write
In Flex i want to upload a particular file to server form local system.how
I use the PHP language for file upload and want to know that the
I am developing an web application which can upload/download a file from client to
Basically my problem is a that I need to copy an uploaded file (which
Hi i want to upload mulitiple file using rails 3 and paperclip please help
I want to reset a file upload field when the user selects another option.
I want a robust way to upload a file. That means that I want

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.