Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To use Cloudinary with Astro, handle uploads on the server, send the submitted file to Cloudinary, then render the returned asset using a delivery URL with any needed image or video transformations. Cloudinary’s Astro tutorial uses a multipart form and the Node.js SDK’s upload_stream method; the browser should not contain your Cloudinary API secret. This guide follows that server-side pattern and explains how to deliver and protect the resulting assets.

How the Astro–Cloudinary workflow fits together

Astro receives the upload request, Cloudinary stores the media and returns asset identifiers, and the browser later requests the asset from a Cloudinary delivery URL. Those URLs can specify transformations such as resizing or format conversion. The uploaded asset is available for delivery once the upload completes. See Cloudinary’s Image and Video APIs overview and upload documentation.

The cited Astro tutorial demonstrates a server-side form upload using Cloudinary’s Node.js SDK. Because an upload handler must process submitted file data and use credentials, use an Astro server-capable deployment rather than relying on a static-only page. The tutorial configures Astro output as server or hybrid; the precise deployment adapter and hosting setup depend on where you deploy.

Configure Astro for server-side uploads

  1. Install and configure a server-capable Astro deployment adapter appropriate for your host.

    Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
    #1 Best Overall
    Elebase USB to USB C Adapter for iPhone 18 Pro Max,USBC Car Charger Adapter
    • Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
    • Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
    • Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
    • Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
    • 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
  2. In astro.config.mjs, set the output mode to server or hybrid, as shown in Cloudinary’s Astro upload tutorial.

  3. Store Cloudinary credentials in server-only environment variables. Do not expose the API secret in client-side code or public environment variables.

  4. Create a server endpoint or action that accepts a multipart form submission, validates the file, and uploads it to Cloudinary.

A static-only Astro site can still display Cloudinary assets, but it cannot itself run the server-side request handler described here. In that case, use a separate server endpoint or configure a server-capable deployment.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Anker USB-C Hub, 5-in-1 USB Hub for Laptops, 4K HDMI Multiport Adapter
  • 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
  • 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
  • Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
  • 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
  • What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.

Build a multipart form and upload handler

Form

Use a POST form with multipart/form-data so the submitted image arrives as a file. The form action should point to the Astro endpoint that performs the upload.

<form method="POST" action="/api/upload" enctype="multipart/form-data">
  <label for="image">Choose an image</label>
  <input id="image" name="image" type="file" accept="image/*" required>
  <button type="submit">Upload</button>
</form>

The accept attribute helps guide the user’s file selection; it is not server-side validation.

Server-side upload logic

In the endpoint, read the multipart form, confirm that the submitted value is a file, and enforce the file types and size limits appropriate to your application before passing bytes to Cloudinary. Cloudinary’s tutorial converts the file contents to binary data and wraps the Node SDK’s upload_stream call in a promise. Keep the credentials on the server and handle both SDK errors and invalid submissions.

The endpoint’s exact file location and response conventions depend on the Astro version and project structure. The core upload call should use the Cloudinary Node.js SDK’s upload_stream, with the file bytes written to the stream and the completion result returned to the caller. The upload response includes identifiers such as the public ID and version that you can use to construct a delivery URL.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
Anker USB C Hub, 7in1 Multi-Port USB Adapter, 4K@60Hz USBC to HDMI Splitter
  • Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
  • Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
  • Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
  • Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
  • What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.

For an uploaded file, show a success state or preview only after the server confirms the upload. Cloudinary’s Astro tutorial uses unpic for on-the-fly preview resizing and format conversion; the broader image transformation API also supports transformations expressed in delivery URLs or generated programmatically through Cloudinary SDKs. See Cloudinary’s Astro tutorial and image transformations documentation.

Choose the right upload trust boundary

Cloudinary’s REST upload endpoint follows this pattern: https://api.cloudinary.com/v1_1/<cloud name>/<resource_type>/upload. The resource type can be image, raw, video or auto. Cloudinary supports authenticated uploads and restricted unauthenticated uploads; signed upload presets can define optional upload parameters. The Astro tutorial’s example is server-side and uses the Node SDK. See Cloudinary’s upload documentation.

  • Server-side SDK upload: The Astro server receives the file and uses server-only credentials. This keeps the API secret out of the browser, but means uploads pass through your server and are subject to its request and deployment constraints.
  • Direct browser upload: A deliberately configured unsigned upload preset can allow browser-to-Cloudinary uploads. Cloudinary restricts unauthenticated uploads for security reasons; configure the preset and abuse controls carefully. Never put the API secret in browser code.

Validate incoming files on the server even if the form restricts file selection. Set application-appropriate limits for size and accepted formats, and reject unexpected submissions before uploading. These checks reduce accidental or abusive uploads; the appropriate limits depend on your product and hosting constraints.

Render images and video with delivery URLs

A Cloudinary delivery URL identifies the cloud name, asset type, delivery type, optional transformations, optional version and public ID. Image URLs use the image asset type; video URLs use video. Transformations can resize, crop, adjust quality or format, among other operations. Cloudinary generates derived assets on first access and caches them on its CDN for later requests. See the transformation URL API reference and video transformations documentation.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
UGREEN USB to USB C Adapter Combo 4-Pack, 10Gbps USB C Converter Space Gray
  • Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
  • Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
  • Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
  • Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
  • Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft

Images

Use delivery transformations to produce the dimensions and format needed for a preview or page layout. For responsive previews, Cloudinary’s Astro tutorial points to unpic for on-the-fly resizing and format conversion. If you construct delivery URLs yourself, ensure the public ID and any version component come from the upload result rather than assumptions about the uploaded filename.

Video

Use the video asset type in the delivery URL and apply supported video transformations as needed. Cloudinary’s JavaScript video documentation covers resizing, cropping, rotation, video quality and format, automatic quality or format, and overlays. A video player is only necessary if the application needs player-specific capabilities; upload and transformed delivery do not by themselves require Cloudinary’s player. See JavaScript video streaming and transformations.

Decide whether uploaded assets should be public or restricted

Choose the delivery type based on who should be able to fetch an asset. Cloudinary’s default upload delivery type is generally public, subject to any restrictions you configure. A private asset requires a signed URL for the original, while transformed versions may be public unless strict transformations are enabled. Authenticated assets require a signed URL or authentication token for both originals and transformed versions. See Cloudinary’s video delivery types and transformation flags.

For user-generated or confidential media, make the access decision before exposing delivery URLs. A URL that is publicly fetchable is not made private simply by hiding it in the page; choose a restricted delivery mode and implement its signing or token requirements.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Anker USB C Hub, 5-in-1 USBC to HDMI Splitter with 4K Display
  • 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
  • Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
  • Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
  • HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
  • What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Performance, reliability and cost considerations

  • Request path: With server-side upload, the file reaches your Astro server before Cloudinary. Account for the request size and execution limits imposed by your host.
  • Availability after upload: Cloudinary states that uploads are synchronous and that an asset is immediately available for transformation and delivery once upload completes. Treat a successful upload response as the point to offer a preview.
  • Repeated transformed delivery: Derived assets are generated on first access and cached on Cloudinary’s CDN for later requests; avoid needlessly creating many distinct transformation variants.
  • Cost: The sources cited here establish the upload and delivery behavior, not a price estimate for a specific application. Check your Cloudinary plan and expected storage, transformation and delivery usage before estimating spend.
  • Failure handling: Return an appropriate error when validation or upload fails, and do not render a delivery URL as if upload succeeded. Keep logs useful for diagnosing server-side failures without exposing secrets.

Troubleshoot common upload and delivery problems

  • The form reloads but no asset appears: Confirm the form uses method="POST", enctype="multipart/form-data", the field name expected by the endpoint, and the correct action path.
  • The handler cannot process the request on deployment: A static-only output cannot run this server-side handler. Configure server or hybrid output and a compatible deployment adapter, or move the upload endpoint to a server-capable service.
  • Cloudinary rejects the upload: Check server-side credentials, cloud name, resource type, upload configuration and the file validation result. Do not attempt to solve credential problems by exposing the API secret to the browser.
  • The uploaded asset exists but the preview URL fails: Build the URL from the upload response’s identifiers, verify the asset type and delivery type, and check whether the selected access mode requires a signed URL or token.
  • The original loads but a transformed URL does not: Review the transformation syntax and the asset’s delivery restrictions. Private assets can expose transformed versions unless strict transformations are configured; authenticated assets require authorization for originals and transformed versions.
  • The video transformation does not behave as expected: Confirm that the delivery URL uses the video asset type and review the supported video transformation options in Cloudinary’s video transformation reference.

Or skip the browser setup: use ScreenshotNeo for website screenshots

ScreenshotNeo is a separate website screenshot API and MCP server, not a Cloudinary upload or media-transformation service. If your Astro workflow also needs a screenshot of a rendered website, one GET request can return a PNG, JPEG, WebP or PDF. See ScreenshotNeo and its API documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

Cookie banners are accepted and removed before capture, along with known newsletter popups and chat widgets; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads and cache hits cost nothing, with response headers identifying the page verdict and billing status. Its MCP server provides screenshot and PDF tools for AI agents. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo and start with 1,000 free screenshots a month, no card required.

Frequently Asked Questions

Can a static Astro site display Cloudinary images?

Yes. Static pages can display Cloudinary delivery URLs; only the server-side upload handler described here requires server-capable execution.

Does uploading a file make its Cloudinary URL private?

No. Access depends on the asset’s delivery type and configured restrictions, not whether its URL is hidden from the page.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.