title: How to get URL of file uploaded to Azure Storage via Node.js?
body: <p>I am trying to retrieve the URL of the file I just uploaded to Azure Storage using node.js. My code for the upload is this:</p>
  
  <p>[Notes: I'm using Ember-droplet, so the 'zone' is where files are dragged and dropped. This is the server side code to handle the route where a POST request is sent in order to upload files. ]</p>
  
  <pre><code>// Responsible for the call to OPTIONS.
  app.options('/upload', function(request, response) {
      response.send(200);
  });
  
  /* Responsible for file upload. */
  app.post('/fileUpload', function(request, response) {
  
      /* Get the files dropped into zone. */
      var files       = request.files.file,
          promises    = [];
  
      /**
       * @method uploadFile
       * @param file {Object}
       * @return {Object}
       * Function takes a general param file, creates a blob from it and returns the promise to upload it.
       * Promise: jQuery promise = all done later. 
       */
      var uploadFile = function(file) {
          var deferred = new Deferred();
  
          // Actual upload code.
          // Also replace 'profile-pictures with abstracted container name.'
          blobService.createBlockBlobFromFile('profile-pictures', file.name, file.path, function(error, result, response) {
              if (!error) {
                  deferred.resolve(file.name);
                  console.log("result:");
                  console.log(result);
  
                  console.log("response:");
                  console.log(response);
              }
          });
  
          return deferred.promise;
      };
  
      if (!Array.isArray(files)) {
  
          // We're dealing with only one file.
          var promise = uploadFile(files);
          promises.push(promise);
  
      } else {
  
          // We're dealing with many files.
          files.forEach(function(file) {
              var promise = uploadFile(file);
              promises.push(promise);
          });
  
      }
  
      var fileUrls = [];
      // Send all files in the promise to execute.
      promisedIo.all(promises).then(function(files) {
              response.send({ files: files, success: true });
              response.end();
  
      });
  });
  </code></pre>
  
  <p>I printed out the results and response and this is what I get:</p>
  
  <pre><code>result:
  { container: 'profile-pictures',
    blob: 'robot.jpeg',
    etag: '---blah---',
    lastModified: 'Mon, 30 Jun 2014 14:38:09 GMT',
    contentMD5: '---blah---',
    requestId: '---blah---' }
  response:
  { isSuccessful: true,
    statusCode: 201,
    body: '',
    headers: 
     { 'transfer-encoding': 'chunked',
       'content-md5': '---blah---',
       'last-modified': 'Mon, 30 Jun 2014 14:38:09 GMT',
       etag: '"---blah---"',
       server: 'Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0',
       'x-ms-request-id': '---blah---',
       'x-ms-version': '2014-02-14',
       date: 'Mon, 30 Jun 2014 14:38:08 GMT' },
    md5: undefined }
  </code></pre>
  
  <p>None of these seem to include the URL of the file I just posted; I'm not sure how to get the URL at all. Is there a method of blobservice I'm missing, or anything like that. </p>
  
  <p>One 'solution' I found is to hardcode it with: </p>
  
  <p>http:///blob.core.windows.net//blob-name,</p>
  
  <p>But I feel uncomfortable with that. Is there a way to extract this URL and if so, how?</p>