title: How to upload files & Get the public url Google Drive Api?
body: <p>I create a simple website for Uploading files on Google Drive using Google Drive Api.</p>
  <p>This is My Code :</p>
  <pre><code>        $.ajax({
              type: &quot;POST&quot;,
              beforeSend: function(request) {
                  request.setRequestHeader(&quot;Authorization&quot;, &quot;Bearer&quot; + &quot; &quot; + localStorage.getItem(&quot;accessToken&quot;));
                  
              },
              url: &quot;https://www.googleapis.com/upload/drive/v2/files?uploadType=multipart&amp;fields=webViewLink&quot;,
              data:{
                  uploadType:&quot;media&quot;
              },
              xhr: function () {
                  var myXhr = $.ajaxSettings.xhr();
                  if (myXhr.upload) {
                      myXhr.upload.addEventListener('progress', that.progressHandling, false);
                  }
                  return myXhr;
              },
              success: function (data) {
                  console.log(data);
              },
              error: function (error) {
                  console.log(error);
              },
              async: true,
              data: formData,
              cache: false,
              contentType: false,
              processData: false,
              timeout: 60000
          });
      };
     
      
      Upload.prototype.progressHandling = function (event) {
          var percent = 0;
          var position = event.loaded || event.position;
          var total = event.total;
          var progress_bar_id = &quot;#progress-wrp&quot;;
          if (event.lengthComputable) {
              percent = Math.ceil(position / total * 100);
          }
          // update progressbars classes so it fits your code
          $(progress_bar_id + &quot; .progress-bar&quot;).css(&quot;width&quot;, +percent + &quot;%&quot;);
          $(progress_bar_id + &quot; .status&quot;).text(percent + &quot;%&quot;);
      };
  
      $(&quot;#upload&quot;).on(&quot;click&quot;, function (e) {
          var file = $(&quot;#files&quot;)[0].files[0];
          var upload = new Upload(file);
      
          // maby check size or type here with upload.getSize() and upload.getType()
      
          // execute upload
          upload.doUpload();
      });
  
  
  
      
  });
  </code></pre>
  <p>Everything is Oky, But I just want to get the public URL of The files  I just want to show the public url after file uploaded. Help Me Please</p>