Loading...

Android Development Tutorial - Upload file with PHP Backend

Android Development Tutorial - Upload file with PHP Backend
Link donate : https://www.paypal.me/edmtdev
Facebook : http://facebook.com/edmtdev
#PHPWebServiceAndroidEDMTDev #AndroidEDMTDev #EDMTDev 

In this tutorial , i will show you how to make  upload image file to Server from Android app use PHP web API

android development tutorial,
android programming tutorial,
android app development tutorial,
android tutorial for beginners ,
android app tutoria,
android studio tutorial,
learn android programming ,
android developer tutorial ,
android programming,
android development,
android studio tutorial for beginners,
android course,
android training,
android development course,
android app development course

RRelated Posts

Android Image Upload to App Server using Volley

This video demonstrate how to upload images from your android app to a folder in application server using Volley. Here we use php as server scripts and database is MySQL. Like my Facebook page :

CComments

  • Dondell Batac
    I cannot successfully upload file. It returned message Response{protocol=http/1.1, code=403, message=Forbidden,
  • YTkais
    why not stored in database?
  • Cantinho TECnologico
    Help , getting an error while Launching app, says Cannot find Launcher Activity..

    Here's my AndroidManifest.xml file


    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gladius.survey">

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.RECORD_AUDIO" />


    <uses-feature
    android:name="android.hardware.camera"
    android:required="false" />
    <uses-feature
    android:name="android.hardware.camera.autofocus"
    android:required="false" />
    <uses-feature
    android:name="android.hardware.camera.flash"
    android:required="false" />


    <application
    android:allowBackup="true"
    android:icon="@mipmap/edm_icon"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/edm_icon"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
    android:name=".Login_Loja"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden">
    <intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.HOME" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    </activity>

    <activity
    android:name="com.ipaulpro.afilechooser.FileChooserActivity"
    android:icon="@drawable/ic_chooser"
    android:enabled="@bool/use_activity"
    android:exported="true"
    android:label="@string/choose_file">
    <intent-filter>
    <action android:name="android.intent.action.GET_CONTENT" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.OPENABLE" />

    <data android:mimeType="*/*" />
    </intent-filter>
    </activity>

    <service
    android:name=".services.UpdateService"
    android:exported="false" />

    <activity
    android:name=".Activity_avaliar_atendd"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:windowSoftInputMode="adjustResize|stateHidden" />
    <activity
    android:name=".Registar_Loja"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity
    android:name=".Publish"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity
    android:name=".Comentar"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:windowSoftInputMode="adjustResize|stateHidden" />
    <activity
    android:name=".FullscreenActivity"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity
    android:name=".Select"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity android:name=".Comentado" />
    <activity
    android:name=".activity.CategoriaActivity"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity
    android:name=".activity.Activity_actualizar_atend"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape" />
    <activity
    android:name=".activity.Activity_avaliar_atend"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden"/>
    <activity
    android:name=".activity.Activity_comentar_landscape"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity
    android:name=".activity.Activity_decide"
    android:launchMode="singleTop"
    android:screenOrientation="landscape"
    android:theme="@style/AppTheme.NoTitle" />
    <activity
    android:name=".activity.Activity_escolha_final1" />
    <activity
    android:name=".activity.ActivitySlide" />
    <activity
    android:name=".activity.Questions"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:theme="@style/AppTheme.NoTitle"
    android:windowSoftInputMode="stateHidden" />
    <activity
    android:name=".activity.Activity_escolha_final"
    android:label="@string/title_activity_question"
    android:theme="@style/AppTheme.NoTitle" />
    <provider
    android:name="android.support.v4.content.FileProvider"
    android:authorities="${applicationId}.provider"
    android:exported="false"
    android:grantUriPermissions="true">
    <meta-data
    android:name="android.support.FILE_PROVIDER_PATHS"
    android:resource="@xml/file_paths" />
    </provider>

    <activity
    android:name=".activity.Activity_actualizar_atend_final"
    android:launchMode="singleTop"
    android:screenOrientation="sensorLandscape"
    android:windowSoftInputMode="adjustResize|stateHidden" />



    </application>

    </manifest>
  • Sudin Joshi
    Very good tutorial sir. Can you please tell me what changes should I have to make in this code in order to upload mp3 files instead of image files :)
    Thank you in advance
  • Franz Dumz
    What if I wanted to upload pdf files and upload data of it in the database? like the ID of the user that uploaded it. Can you give me an idea on the process and flow of it thanks
  • Drs 743
    this is great. how files stored in mysqli hdan database get the url from the file
  • ROHIT K BHARADWAJ
    aFilechooser is deprecated
  • Penghasil Uang
    hy sir,, how to make upload video in android studio, what you have the tutorial ?
  • wee li
    Hi Sir, can we get a simplified version without all the features like progressbar, just go directly on uploading the image.
    Besides, i am currently dealing with iTextPDF, which i wanted to upload the pdf , as long as i convert it to pdf.

    final MultipartBody.Part body = MultipartBody.Part.createFormData("uploaded_file", file1.getName());

    new Thread(new Runnable() {
    @Override
    public void run() {

    mService.uploadFile(body).enqueue(new Callback<String>() {
    @Override
    public void onResponse(Call<String> call, Response<String> response) {
    Toast.makeText(getApplicationContext(), "Uploaded!", Toast.LENGTH_SHORT).show();
    }

    @Override
    public void onFailure(Call<String> call, Throwable t) {
    Toast.makeText(getApplicationContext(), t.getMessage(), Toast.LENGTH_SHORT).show();
    }
    });
    }
    }).start();

    Can i just put this right under the code that converts the pdf...

    Thanks!
  • xp Android
    Can I use this code to upload video file on server by changing "/image" to "/video" and How I can send user ID with file ? What request will be to Upload file along with User ID? Please give me code of request.
  • Fauzi Muhammad
    sir please help me
    How resolve this "The minSdk version should not be declared in the android manifest file. You can move the version from the manifest to the defaultConfig in the build.gradle file" in build gradle 3.2.0?
  • shani pratap
    sir aFileChooser is depcricated which library should use,for choose a file please help me
  • Jereh Tejano
    The imageview function doesn't reflect when i select a file, and my upload doesn't do anything
  • Rehan Yousaf
    Awesome! Thank you mate. I've been struggling with this for a couple of days. You really saved the day. Earned your subscribe and like :)
  • shani pratap
    Pause and resume uploaded process... How to achieve it...
  • Ryan Hallberg
    My upload doesn't create an assets folder or upload anything.
  • mani ortan
    uploading doesnt works sir.,otherwise all tasks are go well.,
    what can i do right now sir.,
  • Sakar Mehra
    If you speak and tell the audience what and why you are doing the stuffs that helps a lot better than
  • Jon Finkin
    can i auto upload from caching an audio file?
  • sajid amin
    how to upload more than 1 image to local server?
  • Subbir Hosain
    how to implent wysiswyg editor in android for blog post.plz make video on this
  • Mohammad Irfan
    if i m not using file chooser then can i do this??
  • Mohammad Irfan
    please sir make tutorial how to search particular data after fetched from server in RecyclerView..please please plz sir i am struggling from many days
  • mani ortan
    sir i using sqlyog for my web projects,when i install xampp i cant use randomly cause i solved error from xampp sql error - shutdown unexpectedly.,after clear that sqlyog dats are gone.,give me a suggestion to use which one is reliable and cabable to manage both android and web projects..
  • mani ortan
    really useful tutorial sir thank u,
    my request is view the file after upload it,and delete it and show the status like nothing .,
    if its happen very useful to me as a beginner of this development thanks in advance..
  • Subrahmanyam Abhishek A Y
    Why don't you make Our Data Storage, like Firebase Database ,and RecyclerAdapterView, N u know other features of the Firebase Database , hope you will do tutorials on that concept...
  • Jose - Intigen
    Nyc video sir... Can I upload any type of files like pdf,word,excel,etc.... from this app?
  • MImran Khan
    sir plz make a tutorial on android php crud operation and video upload tutorials
  • android lover
    that very cool bro thank you for this valuable toutrials ..can you please complete the wallpaper app
  • mahdi shoj
    Tank you Master :)
  • Wrestling. Com
    web based app upload image and text to firebase ple make tutorial bro
  • Jatt Tera
    please make a video on how to make "update app dialog" json call website
  • Subrahmanyam Abhishek A Y
    Create authentication system using PHP,
  • reza youn
    NICE DEAR THANKS.OK PLS COMPLATE WALLPAPER TUTORIAL TOO/.
  • Channel Channel
    Plz reply Can I upload a more movie in this app.
  • Stefan C
    How can we send image using intents from other applications to our app?
    Can you please make a video about that?
  • Shabab Km
    Thanks Sir , supr Vedio , Please Create a Tutorial , User login and register and upload image and some text , edit and delite upload item, show all upload content , edit profile then more , please create this modeal app tutorila
  • mostafa saad
    Can you please sir make tutorial about tensorflow please
  • Hamza Ashraf
    Waaao I am Just waiting this from you <3 <3 :)
  • Channel Channel
    When i earn money for this knowledge i will donate.. 1st im going to watch your full video now and start making.
  • Shariq Khan
    thankyou so much sir. i hope we will be doing one complete app with php and android :)
  • LEGEND MORTAL
    bro please also make video on how to update progressBar progress in activity from Service which is doing downloading stuff i.e. how to send that downloading progress to activity to update ui of ProgressBar

    I have tried this with broadcast receiver but it receives broadcast after all downloading is finished i.e. receives all 1 to 100 % at once even though its big file
  • Fahim Khan
    Many thanks sir I was looking for this only and there your video pop up 👍👍👍😀😃😀
  • Hugins
    Best channel <3
  • Mohamud Osman Hamud
    Heheya Great job but I would like with mysql database that is the best approach.
    I suggest you my dear to create a lot of tutorial with php my SQL and android many tutorials in the YouTube channel About that lessons but I liked to your lessons Because you are making with Experience. thansk for your time.
  • Lets Learn
    Thank you brother
  • Subrahmanyam Abhishek A Y
    Backend system should be online 24/7 right bro
  • Abhayraj Prajapati
    Awesome dude...
    You are best.
    I love your channel... 10 out of 10 Bro... suprbbbbbbbbb
  • Velosh - Block Strike
    wow