Uploads the transit app file
 @param app_version (AppVersion): The version of your app
 @param upload_file (UploadFile): The image to upload
 @return [JSON] the response
544230
def upload_geojson(app_version, upload_file)
      raise "app_version is required" unless app_version
      raise "upload_file is required" unless upload_file

      du_client.upload_geojson(app_version, upload_file, content_provider_id, sso_token_for_image)
    end
361390
def version(app, appbuilder):
    
    _appbuilder = import_application(app, appbuilder)
    click.echo(
        click.style(
            "F.A.B Version: {0}.".format(_appbuilder.version), bg="blue", fg="white"
        )
    )
1326054
def _create_or_update_version(app_name, version, app_spec, try_update=True):
    
    # This has a race condition since the app could have been created or
    # published since we last looked.
    try:
        app_id = dxpy.api.app_new(app_spec)["id"]
        return app_id
    except dxpy.exceptions.DXAPIError as e:
        # TODO: detect this error more reliably
        if e.name == 'InvalidInput' and e.msg == 'Specified name and version conflict with an existing alias':
            print('App %s/%s already exists' % (app_spec["name"], version), file=sys.stderr)
            # The version number was already taken, so app/new doesn't work.
            # However, maybe it hasn't been published yet, so we might be able
            # to app-xxxx/update it.
            app_describe = dxpy.api.app_describe("app-" + app_name, alias=version)
            if app_describe.get("published", 0) > 0:
                return None
            return _update_version(app_name, version, app_spec, try_update=try_update)
        raise e
1032470
def upload_file(f)
      # grabs the compiled asset from public_path
      full_file_path = File.join(File.dirname(@manifest.dir), f)
      one_year = 31557600
      mime = Rack::Mime.mime_type(File.extname(f)) 
      file = {
        :key => f,
        :public => true,
        :content_type => mime,
        :cache_control => "public, max-age=#{one_year}",
        :expires => CGI.rfc1123_date(Time.now + one_year) 
      }

      gzipped = "#{full_file_path}.gz" 

      if File.exists?(gzipped)
        original_size = File.size(full_file_path)
        gzipped_size = File.size(gzipped)

        if gzipped_size < original_size
          file.merge!({
            :body => File.open(gzipped),
            :content_encoding => 'gzip'
          })
          log "Uploading #{gzipped} in place of #{f}"
        else
          file.merge!({
            :body => File.open(full_file_path)
          })
          log "Gzip exists but has larger file size, uploading #{f}"
        end
      else
        file.merge!({
          :body => File.open(full_file_path)
        })
        log "Uploading #{f}"
      end
      # put in reduced redundancy option here later if desired

      file =  bucket.files.create( file )
    end
186987
def upload_large_icon(app_version, upload_image)
      raise "app_version is required" unless app_version
      raise "upload_image is required" unless upload_image

      du_client.upload_large_icon(app_version, upload_image, content_provider_id, sso_token_for_image)
    end
249672
def upload_module(self, local_path=None, remote_path="/tmp/lime.ko"):
        
        if local_path is None:
            raise FileNotFoundFoundError(local_path)
        self.shell.upload_file(local_path, remote_path)
508323
def upload_trailer_preview(app_version, upload_trailer_preview, device)
      raise "app_version is required" unless app_version
      raise "upload_trailer_preview is required" unless upload_trailer_preview
      raise "device is required" unless device

      du_client.upload_trailer_preview(app_version, upload_trailer_preview, content_provider_id, sso_token_for_image, device)
    end
862814
def upload!(local_file)
      @remote.directory.files.create(
        key:            local_file.key,
        body:           local_file.body,
        cache_control:  "public, max-age=#{max_age(local_file)}",
        public:         true
      )
    end
1111707
def upload_to(instance, filename, prefix=None):
    
    ext = path.splitext(filename)[1]
    name = str(instance.pk or time()) + filename

    # We think that we use utf8 based OS file system
    filename = md5(name.encode('utf8')).hexdigest() + ext
    basedir = path.join(instance._meta.app_label, instance._meta.module_name)
    if prefix:
        basedir = path.join(basedir, prefix)
    return path.join(basedir, filename[:2], filename[2:4], filename)
22367
protected function uploadToGithub($version, $githubToken, $upload_url)
	{
		$deploy  = explode(' ', $this->getJConfig()->target);
		$zipfile = $this->getExtensionName() . '-' . $this->getJConfig()->version . '.zip';

		if (in_array('package', $deploy))
		{
			$zipfile = 'pkg-' . $zipfile;
		}

		$zipfilepath = JPATH_BASE . '/dist/' . $zipfile;

		$filesize = filesize($zipfilepath);

		$this->say('Uploading the Extension package to the Github release: ' . $version);

		$uploadUrl = str_replace("{?name,label}", "?access_token=" . $githubToken . "&name=" . $zipfile . "&size=" . $filesize, $upload_url);
		$request   = curl_init($uploadUrl);

		curl_setopt($request, CURLOPT_POST, true);
		curl_setopt($request, CURLOPT_VERBOSE, true);

		curl_setopt($request, CURLOPT_HTTPHEADER, array(
			'Authorization: token ' . $githubToken,
		));

		curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-type: application/zip'));
		curl_setopt($request, CURLOPT_POSTFIELDS, file_get_contents($zipfilepath));
		curl_setopt($request, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($request, CURLOPT_SSL_VERIFYPEER, 0);

		$result = curl_exec($request);

		curl_close($request);

		$this->say(print_r($result, true));
	}
1004520
def apps_upload_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/apps/uploads.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
488177
def _post(self, data, file_to_upload=None):
        
        # pylint: disable=E1101
        params = {"JSONRPC": simplejson.dumps(data)}
        req = None
        if file_to_upload:
            req = http_core.HttpRequest(self.write_url)
            req.method = 'POST'
            req.add_body_part("JSONRPC", simplejson.dumps(data), 'text/plain')
            upload = file(file_to_upload, "rb")
            req.add_body_part("filePath", upload, 'application/octet-stream')
            req.end_of_parts()
            content_type = "multipart/form-data; boundary=%s" % \
                http_core.MIME_BOUNDARY
            req.headers['Content-Type'] = content_type
            req.headers['User-Agent'] = config.USER_AGENT

            req = http_core.ProxiedHttpClient().request(req)
        else:
            msg = urllib.urlencode({'json': params['JSONRPC']})
            req = urllib2.urlopen(self.write_url, msg)

        if req:
            result = simplejson.loads(req.read())
            if 'error' in result and result['error']:
                exceptions.BrightcoveError.raise_exception(
                    result['error'])
            return result['result']
1129657
def upload(self):
        '''
        
        '''
        if not self.exists():
            self.create()

        data = self.stage().json()
        self.file_upload(data['post_url'], data)
        res = self.commit(data['dist_id'])
        data = res.json()
        return data
200267
def version_already_uploaded(project_name, version_str, index_url, requests_verify=True):
    
    all_versions = _get_uploaded_versions(project_name, index_url, requests_verify)
    return version_str in all_versions
1064616
def upload_asset(self, path, label="", content_type=""):
        
        assert isinstance(path, (str, unicode)), path
        assert isinstance(label, (str, unicode)), label

        post_parameters = {
            "name": basename(path),
            "label": label
        }
        headers = {}
        if len(content_type) > 0:
            headers["Content-Type"] = content_type
        resp_headers, data = self._requester.requestBlobAndCheck(
            "POST",
            self.upload_url.split("{?")[0],
            parameters=post_parameters,
            headers=headers,
            input=path
        )
        return github.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True)
1277138
def upload(self, payload=None, content_type=None):
        
        # platform - prefer the value passed in to func over config
        payload = payload or self.config.payload
        content_type = content_type or self.config.content_type

        if payload is None:
            raise ValueError('Specify a file to upload.')

        if not os.path.exists(payload):
            raise IOError('Cannot upload %s: File does not exist.' % payload)

        upload_results = client.upload(
            self.config, self.connection, payload, content_type)

        # return api response
        return upload_results
1037903
def file_upload(context, id, path):
    
    result = component.file_upload(context, id=id, file_path=path)
    utils.format_output(result, context.format)