Skip to content

Instantly share code, notes, and snippets.

View optlsnd's full-sized avatar
⚖️

Alex Chernenko optlsnd

⚖️
View GitHub Profile
{"hook": {"id": 117287, "event": "file.uploaded", "target": "http://webhook.site/12af134f-20c1-4fe8-ad33-95067542f6d7"}, "data": {"uuid": "0d42a712-a9a9-40d8-bf5e-a6a095fe9162", "is_image": true, "filename": "ddd.jpg", "is_stored": true, "done": 40020, "file_id": "0d42a712-a9a9-40d8-bf5e-a6a095fe9162", "original_filename": "ddd.jpg", "image_info": {"orientation": null, "format": "JPEG", "height": 668, "width": 1000, "geo_location": null, "datetime_original": null, "dpi": null}, "is_ready": true, "total": 40020, "mime_type": "image/jpeg", "size": 40020}, "file": "https://ucarecdn.com/0d42a712-a9a9-40d8-bf5e-a6a095fe9162/ddd.jpg"}
const axios = require('axios') // needs to be installed with "npm i axios --save"
const PUBLIC_KEY = 'your_public_key_here'
const SECRET_KEY = 'your_secret_key_here'
const endpoint = 'https://api.uploadcare.com/files/?limit=1000&removed=false'
const config = {
headers: {
"Authorization": `Uploadcare.Simple ${PUBLIC_KEY}:${SECRET_KEY}`
var $ = uploadcare.jQuery
function fileTypeLimit(types) {
types = types.split(' ')
return function(fileInfo) {
if (fileInfo.name === null) {
return
}
var extension = fileInfo.name.split('.').pop()
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Test JS upload</title>
<script src="uploader.js"></script>
</head>
<body>
package main
import (
"fmt"
"log"
"context"
"github.com/uploadcare/uploadcare-go/ucare"
"github.com/uploadcare/uploadcare-go/upload"
)
{
"name": "Integration HTTP",
"flow": [
{
"id": 1,
"module": "http:ActionSendData",
"version": 3,
"parameters": {
"handleErrors": false,
"useNewZLibDeCompress": true
// Imports
const EdgeAuth = require("akamai-edgeauth");
// Configuration
const encryptionKey =
"73636b61519adede42191efe1e73f02a67c7b692e3765f90c250c230be095211";
const host = "sectest.ucarecdn.com";
const path = "/06933f0d-5f31-425d-a5b8-6c5c2cdaaae6/-/resize/600x/";
const duration = 3200;
import {
listOfFiles,
UploadcareSimpleAuthSchema,
paginate,
} from "@uploadcare/rest-client";
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: process.env.UC_PUBLIC_KEY,
secretKey: process.env.UC_SECRET_KEY,
});
import {
listOfFiles,
deleteFile,
UploadcareSimpleAuthSchema,
paginate,
} from "@uploadcare/rest-client";
// Replace demo API keys with yours
const uploadcareSimpleAuthSchema = new UploadcareSimpleAuthSchema({
publicKey: "demopublickey",