title: Unable to Upload Image to Server using Fast Android Networking Library
body: <p>I am trying to upload an image from storage to server. Am I doing anything wrong here? Do I need to use a PHP script for this?</p>
  
  <p>private class UploadImage extends AsyncTask{</p>
  
  <pre><code>    File picPath;
      String picName;
  
      public UploadImage(File picPath, String picName){
          this.picPath= picPath;
          this.picName = picName;
      }
  
      @Override
      protected Void doInBackground(Void... params) {
          String uril = getResources().getString(R.string.ServerPath) + "MyFiles/" + picName;
          AndroidNetworking.upload(uril)
                  .addMultipartFile(picName, picPath)
                  .addMultipartParameter("key","value")
                  .setPriority(Priority.MEDIUM)
                  .build()
                  .setUploadProgressListener(new UploadProgressListener() {
                      @Override
                      public void onProgress(long bytesUploaded, long totalBytes) {
                          if (bytesUploaded == totalBytes){
                              Toast.makeText(getApplicationContext(), "Image Uploaded!",Toast.LENGTH_SHORT).show();
                          }
  
                      }
                  });
  
          return null;
      }
  
      @Override
      protected void onPostExecute(Void aVoid) {
          super.onPostExecute(aVoid);
          Toast.makeText(getApplicationContext(), "Uploaded!",Toast.LENGTH_SHORT).show();
  
      }
  }
  </code></pre>