Open MiroslavPetrik opened 1 year ago
Hello I don't see the direct_upload method in the v2 api.
direct_upload
v2
https://developers.cloudflare.com/images/cloudflare-images/upload-images/direct-creator-upload/
so far I have custom wrapper
import { env } from "../../env/server.mjs"; type DirectUploadUrlResult = { result: { id: string; uploadURL: string; }; result_info: string | null; success: boolean; errors: []; // todo messages: []; // todo }; export const fetchDirectUploadUrl = async (): Promise<DirectUploadUrlResult> => { const resp = await fetch( `https://api.cloudflare.com/client/v4/accounts/${env.CLOUDFLARE_ACCOUNT_ID}/images/v2/direct_upload`, { method: "POST", headers: { Authorization: `Bearer ${env.CLOUDFLARE_API_TOKEN}` }, } ); return await resp.json(); };
year has passed CF has new api pages wonderful
https://developers.cloudflare.com/api/operations/cloudflare-images-create-authenticated-direct-upload-url-v-2
Hello I don't see the
direct_upload
method in thev2
api.https://developers.cloudflare.com/images/cloudflare-images/upload-images/direct-creator-upload/
so far I have custom wrapper