Starts the upload.
        :raises SbgError: If upload is not in PREPARING state.
775389
def start(self):
        
        if self._status == TransferState.PREPARING:
            super(Upload, self).start()
        else:
            raise SbgError(
                'Unable to start. Upload not in PREPARING state.'
            )
690041
def _call(self, method, url, params, uploads):
        
        try:
            data = self._request(method, url, params, uploads)
        except Exception, e:
            self._failed_cb(e)
        else:
            self._completed_cb(data)
790871
def setup_run(self):
        
        self.state_execution_status = StateExecutionStatus.ACTIVE
        self.preempted = False
        if not isinstance(self.input_data, dict):
            raise TypeError("input_data must be of type dict")
        if not isinstance(self.output_data, dict):
            raise TypeError("output_data must be of type dict")
        self.check_input_data_type()
1356116
def _on_startup(self, *args):
        
        yield from Controller.instance().start()
        # Because with a large image collection
        # without md5sum already computed we start the
        # computing with server start
        asyncio.async(Qemu.instance().list_images())
381692
def set_uploading(self, files_uploaded):
        
        self.files_uploaded = files_uploaded
        self.__record_progress(Status.UPLOADING_FILES)
4333
public function onUploadFileStart($in)
    {
        $this->freezeInput();
        FileSystem::tempnam(ini_get('upload_tmp_dir'), 'php', function ($fp) use ($in) {
            if (!$fp) {
                $in->curPart['fp'] = false;
                $in->curPart['error'] = UPLOAD_ERR_NO_TMP_DIR;
            } else {
                $in->curPart['fp'] = $fp;
                $in->curPart['tmp_name'] = $fp->path;
            }
            $this->unfreezeInput();
        });
    }
1314146
def start(self):
        

        def handle(signum, frame):
            if signum == signal.SIGWINCH:
                self.pty.resize()

        self.original_handler = signal.signal(signal.SIGWINCH, handle)
1096264
@Override
    public void uploadStarted(final StartedEvent event) {
        // reset internal state here because instance is reused for next upload!
        resetState();

        final SoftwareModule softwareModule = getSelectedSoftwareModule();

        this.fileUploadId = new FileUploadId(event.getFilename(), softwareModule);

        if (getUploadState().isFileInUploadState(this.fileUploadId)) {
            // actual interrupt will happen a bit late so setting the below
            // flag
            interruptUploadDueToDuplicateFile();
            event.getUpload().interruptUpload();
        } else {
            LOG.info("Uploading file {}", fileUploadId);
            publishUploadStarted(fileUploadId);

            if (RegexCharacterCollection.stringContainsCharacter(event.getFilename(), ILLEGAL_FILENAME_CHARACTERS)) {
                LOG.info("Filename contains illegal characters {} for upload {}", fileUploadId.getFilename(),
                        fileUploadId);
                interruptUploadDueToIllegalFilename();
                event.getUpload().interruptUpload();
            } else if (isFileAlreadyContainedInSoftwareModule(fileUploadId, softwareModule)) {
                LOG.info("File {} already contained in Software Module {}", fileUploadId.getFilename(), softwareModule);
                interruptUploadDueToDuplicateFile();
                event.getUpload().interruptUpload();
            }
        }
    }
93142
def _begin_request(self):
        
        headers = self.m2req.headers

        self._request = HTTPRequest(connection=self,
            method=headers.get("METHOD"),
            uri=self.m2req.path,
            version=headers.get("VERSION"),
            headers=headers,
            remote_ip=headers.get("x-forwarded-for"))

        if len(self.m2req.body) > 0:
            self._request.body = self.m2req.body

        if self.m2req.is_disconnect():
            self.finish()

        elif headers.get("x-mongrel2-upload-done", None):
            # there has been a file upload.
            expected = headers.get("x-mongrel2-upload-start", "BAD")
            upload = headers.get("x-mongrel2-upload-done", None)

            if expected == upload:
                self.request_callback(self._request)

        elif headers.get("x-mongrel2-upload-start", None):
            # this is just a notification that a file upload has started. Do
            # nothing for now!
            pass

        else:
            self.request_callback(self._request)
364950
def set_uploaded(self, files_uploaded):
        
        self.files_uploaded = files_uploaded
        self.__record_progress(Status.UPLOAD_CHANNEL)
1045362
def set_file_to_upload(self, file_to_upload):
        # type: (str) -> None
        
        if 'url' in self.data:
            del self.data['url']
        self.file_to_upload = file_to_upload
434646
def _finalize_upload(self):
        
        from sevenbridges.models.file import File
        try:
            response = self._api.post(
                self._URL['upload_complete'].format(upload_id=self._upload_id)
            ).json()
            self._result = File(api=self._api, **response)
            self._status = TransferState.COMPLETED

        except SbgError as e:
            self._status = TransferState.FAILED
            raise SbgError(
                'Failed to complete upload! Reason: {}'.format(e.message)
            )
774068
def Start(self):
    """"""
    if self._heapy:
      self._heapy.setrelheap()

      try:
        os.remove(self._sample_file)
      except OSError:
        pass
621207
def start(self):
        
        self.connect()
        if not self.isAlive():
            super(WAMPClient,self).start()
        self.hello()
        return self
88275
def start(self, buffer):
        """"""
        log.debug("In TftpContextServer.start")
        self.metrics.start_time = time.time()
        log.debug("Set metrics.start_time to %s", self.metrics.start_time)
        # And update our last updated time.
        self.last_update = time.time()

        pkt = self.factory.parse(buffer)
        log.debug("TftpContextServer.start() - factory returned a %s", pkt)

        # Call handle once with the initial packet. This should put us into
        # the download or the upload state.
        self.state = self.state.handle(pkt,
                                       self.host,
                                       self.port)
760127
private synchronized void uploadCurrentBlock() throws IOException {
    if (!hasActiveBlock()) {
      throw new IllegalStateException("No active block");
    }
    LOG.debug("Writing block # {}", blockCount);
    if (multiPartUpload == null) {
      LOG.debug("Initiating Multipart upload");
      multiPartUpload = new MultiPartUpload();
    }
    try {
      multiPartUpload.uploadBlockAsync(getActiveBlock());
    } finally {
      // set the block to null, so the next write will create a new block.
      clearActiveBlock();
    }
  }
513955
def run_initial_export(self, events):
        
        if self.uploader is None:  # pragma: no cover
            raise NotImplementedError

        uploader = self.uploader(self)
        uploader.run_initial(events)