Bind Uploading File View Model

@param rid      randomId of uploading file
@param callback View Model file state callback
@return Upload File View Model
547606
@NotNull
    @ObjectiveCName("bindUploadWithRid:withCallback:")
    public UploadFileVM bindUpload(long rid, UploadFileVMCallback callback) {
        return new UploadFileVM(rid, callback, modules);
    }
267492
protected void doHandleThumbnailRequest(final FileWidgetUpload file) {
		// Create thumb nail (if required)
		if (file.getThumbnail() == null) {
			Image thumbnail = createThumbNail(file.getFile());
			file.setThumbnail(thumbnail);
		}
		ContentEscape escape = new ContentEscape(file.getThumbnail());
		throw escape;
	}
158893
public static void uploadAsync(String url, String key, File file, HttpCallback callback) {
        uploadAsync(url, null, callback, new IOParam(key, file));
    }
439136
@NotNull
    @ObjectiveCName("bindFileWithReference:autoStart:withCallback:")
    public FileVM bindFile(FileReference fileReference, boolean isAutoStart, FileVMCallback callback) {
        return new FileVM(fileReference, isAutoStart, modules, callback);
    }
752869
function load (url, callback, sendCallbackWhenAlreadyLoaded) {
        if (sendCallbackWhenAlreadyLoaded == undefined) {
            sendCallbackWhenAlreadyLoaded = true;
        }

        if (isLoaded(url)) {
            if (sendCallbackWhenAlreadyLoaded) {
                callback(url);
            }
            return;
        }

        if (isLoading(url) && !sendCallbackWhenAlreadyLoaded) {
            return;
        }

        var c = callbacks[url];
        if (!c) {
            var image = new Image();
            image.src = url;

            c = [];
            callbacks[url] = c;

            image.onload = function (event) {
                urls[url] = true;
                delete callbacks[url];

                for (var i = 0; i < c.length; i++) {
                    c[i](url);
                }
            }
        }

        if (c.indexOf(callback) == -1) {
            c.push(callback);
        }
    }
572646
protected static UploadStatusDelegate getUploadStatusDelegate(String uploadId) {
        WeakReference<UploadStatusDelegate> reference = uploadDelegates.get(uploadId);

        if (reference == null)
            return null;

        UploadStatusDelegate delegate = reference.get();

        if (delegate == null) {
            uploadDelegates.remove(uploadId);
            Logger.info(TAG, "\n\n\nUpload delegate for upload with Id " + uploadId + " is gone!\n" +
                    "Probably you have set it in an activity and the user navigated away from it\n" +
                    "before the upload was completed. From now on, the events will be dispatched\n" +
                    "with broadcast intents. If you see this message, consider switching to the\n" +
                    "UploadServiceBroadcastReceiver registered globally in your manifest.\n" +
                    "Read this:\n" +
                    "https://github.com/gotev/android-upload-service/wiki/Monitoring-upload-status\n");
        }

        return delegate;
    }
792338
@RequestMapping(value = "/v1/upload",
            method = RequestMethod.POST,
            consumes = "multipart/form-data")
    @ResponseBody
    public final ApiHead upload(
            @RequestParam("file") final MultipartFile file) {
        if (file == null) {
            logger.info("in file upload: file is null");
            return null;
        }
        logger.info("in file upload: " + file.getOriginalFilename());
        storageService.store(file);
        final String name =
                file.getOriginalFilename().replaceAll("\\.ged", "");
        return crud().readOne(name, "");
    }
927048
public void insert(RecordId rid) {
		// Block read-only transaction
		if (tx.isReadOnly() && !isTempTable())
			throw new UnsupportedOperationException();

		// Insertion may change the properties of this file,
		// so that we need to lock the file.
		if (!isTempTable())
			tx.concurrencyMgr().modifyFile(fileName);

		// Open the header
		if (fhp == null)
			fhp = openHeaderForModification();

		// Log that this logical operation starts
		tx.recoveryMgr().logLogicalStart();

		// Mark the specified slot as in used
		moveToRecordId(rid);
		if (!rp.insertIntoTheCurrentSlot())
			throw new RuntimeException("the specified slot: " + rid + " is in used");

		// Traverse the free chain to find the specified slot
		RecordId lastSlot = null;
		RecordId currentSlot = fhp.getLastDeletedSlot();
		while (!currentSlot.equals(rid) && currentSlot.block().number() != FileHeaderPage.NO_SLOT_BLOCKID) {
			moveToRecordId(currentSlot);
			lastSlot = currentSlot;
			currentSlot = rp.getNextDeletedSlotId();
		}

		// Remove the specified slot from the chain
		// If it is the first slot
		if (lastSlot == null) {
			moveToRecordId(currentSlot);
			fhp.setLastDeletedSlot(rp.getNextDeletedSlotId());

			// If it is in the middle
		} else if (currentSlot.block().number() != FileHeaderPage.NO_SLOT_BLOCKID) {
			moveToRecordId(currentSlot);
			RecordId nextSlot = rp.getNextDeletedSlotId();
			moveToRecordId(lastSlot);
			rp.setNextDeletedSlotId(nextSlot);
		}

		// Log that this logical operation ends
		tx.recoveryMgr().logRecordFileInsertionEnd(ti.tableName(), rid.block().number(), rid.id());

		// Close the header (release the header lock)
		closeHeader();
	}
1100877
function(id) {
            var successRequestCallback = this._failedSuccessRequestCallbacks[id];

            return qq.FineUploaderBasic.prototype._manualRetry.call(this, id, successRequestCallback);
        }
1037903
def file_upload(context, id, path):
    
    result = component.file_upload(context, id=id, file_path=path)
    utils.format_output(result, context.format)
1160509
def rooms_upload(self, rid, file, **kwargs):
        """"""
        files = {
            'file': (os.path.basename(file), open(file, 'rb'), mimetypes.guess_type(file)[0]),
        }
        return self.__call_api_post('rooms.upload/' + rid, kwargs=kwargs, use_json=False, files=files)
1240456
function (id, callback) {
    var idIsArr = Array.isArray(id);

    if (!id || (idIsArr && id.length === 0)) {
      return _handleErr('Id required for id API call', callback);
    }

    // If an array of Id's was passed, generate a comma delimited string for
    // the query string.
    if (idIsArr) {
      id = id.join();
    }

    return this._request({
      api: 'gifs',
      query: {
        ids: id
      }
    }, callback);
  }
769233
public function addFileToSet($f_id)
    {
        $app = Application::getFacadeApplication();
        if (is_object($f_id)) {
            $f = $f_id;
            if ($f instanceof FileEntity) {
                $file = $f;
                $fileVersion = $file->getApprovedVersion();
            } else {
                $fileVersion = $f;
                $file = $fileVersion->getFile();
            }
            $f_id = (int) $file->getFileID();
        } else {
            $f_id = (int) $f_id;
            $em = $app->make(EntityManagerInterface::class);
            $file = $em->find(FileEntity::class, $f_id);
            $fileVersion = $file->getApprovedVersion();
        }
        if ($file === null) {
            $result = null;
        } else {
            $file_set_file = File::createAndGetFile($f_id, $this->fsID);
            $fe = new \Concrete\Core\File\Event\FileSetFile($file_set_file);
            $director = $app->make(EventDispatcherInterface::class);
            $director->dispatch('on_file_added_to_set', $fe);
            if ($fileVersion !== null && $this->shouldRefreshFileThumbnails('add')) {
                $fileVersion->refreshThumbnails(false);
            }
            $result = $file_set_file;
        }

        return $result;
    }
326687
function(imageIdentifier, callback) {
        var url = this.getMetadataUrl(imageIdentifier);

        request.del(this.getSignedResourceUrl('DELETE', url), callback);
        return this;
    }
1003651
function(imageIdentifier, shortUrl, callback) {
        var id = shortUrl instanceof ShortUrl ? shortUrl.getId() : shortUrl,
            url = this.getImageUrl(imageIdentifier).setPath('/shorturls/' + id),
            signed = this.getSignedResourceUrl('DELETE', url);

        request.del(signed, callback);
        return this;
    }
1305093
function writeFile(callback) {
        var s = JSON.stringify(images);

        fs.writeFile('imageData.json', s, function (err) {
          if (err) return console.log(err);
          else
            { 
            console.log("success");
            if (callback) callback.call(this, images);
            }
        });


    }
1144957
public int delete(CMAUpload upload) {
    final String uploadId = getResourceIdOrThrow(upload, "upload");
    final String spaceId = getSpaceIdOrThrow(upload, "upload");

    final Response<Void> response = service.delete(spaceId, uploadId).blockingFirst();
    return response.code();
  }