# Can't download video file / ai.files.download(). Veo 3 model response

**URL:** <https://discuss.ai.google.dev/t/cant-download-video-file-ai-files-download-veo-3-model-response/97209>\
**Category:** Gemini API\
**Tags:** veo, models, video\
**Created:** [August 7, 2025, 10:26pm UTC](https://discuss.ai.google.dev/t/cant-download-video-file-ai-files-download-veo-3-model-response/97209 "2025-08-07T22:26:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rapido\_AI](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/rapido_ai/32/31944_2.png) [@Rapido\_AI](https://discuss.ai.google.dev/u/Rapido_AI)\
**Post date:** [August 7, 2025, 10:26pm UTC](https://discuss.ai.google.dev/t/cant-download-video-file-ai-files-download-veo-3-model-response/97209/1 "2025-08-07T22:26:08Z")

</div>

Hi Everyone,

I’m calling the veo 3.0 model but when I try to download the video that I get as a response I must be doing something wrong beacuse the mp4 storage path is empty, it has 0 bytes, and nothing plays on the mp4 player. So it seems it must be a problem of how im downloading the ai.filesdownload() but can’t quite get it solved:

Not sure if anyone has faced a similar issue even if with a different model, and how I could narrow this down. I explain below:

1. Im calling the veo 3.0 as follows:

```auto
// Generate video using Veo 3 and Polling until video ready
          console.log(`Calling Veo 3 API for ${formatName} video...`)
          
          let operation = await ai.models.generateVideos({
            model: "veo-3.0-generate-preview",
            prompt: videoObject.prompt,
            config: {
              aspectRatio: formatData.aspectRatio
            },
          })
          console.log('Video generation operation started:', operation.name) 

```

1. Then im polling until the video is ready

```auto
          let pollCount = 0
          const maxPolls = 60 // Maximum 10 minutes (60 * 10 seconds)
          
          while (!operation.done && pollCount < maxPolls) {
            console.log(`Waiting for video generation to complete... (poll ${pollCount + 1}/${maxPolls})`)
            await new Promise((resolve) => setTimeout(resolve, 10000)) // Wait 10 seconds
            
            operation = await ai.operations.getVideosOperation({
              operation: operation
            })
            
            pollCount++
          }

          if (!operation.done) {
            throw new Error('Video generation timed out after 10 minutes')
          }

          if (operation.error) {
            throw new Error(`Video generation failed: ${operation.error.message || 'Unknown error'}`)
          }

          console.log('Video generation completed successfully')

```

1. Then I’m getting the generated video

```auto
// Get the generated video

          const generatedVideo = operation.response?.generatedVideos?.[0]
            if (!generatedVideo?.video) {
            throw new Error('No video data in response')
          }

          console.log('Generated video file:', generatedVideo.video)

```

Console log above always shows success with the following response, which I assume that means the above is processing correctly:

```auto
"Generated video file: {\n uri: \"https://generativelanguage.googleapis.com/v1beta/files/8bem4xshl3ac:download?alt=media\",\n videoBytes: undefined,\n mimeType: undefined\n}\n"

```

1. Then Im downloading the generated Video

```auto
// Download the video file
          const videoFile = await ai.files.download({
            file: generatedVideo.video
                       
          })

```

Then I work accross other sections of the component to give a storagePath and a name to the VIdeoFile as follows , to upload to S3/Supabase Storage:

```auto
// Preparing variables to save the Video in S3/Supabase Storage
 
const timestamp = Date.now()
const randomId = Math.random().toString(36).substring(2, 15)
const fileName = `ai-video-${formatName}-${timestamp}-${randomId}.mp4`
const storagePath = `ai-generated-videos/${fileName}`

// Getting user's bucket for storage
          const { data: userBucket, error: bucketError } = await supabaseAdmin
            .from('content_buckets')
            .select('bucket_name')
            .eq('user_id', user.id)
            .limit(1)
            .single()

          if (bucketError || !userBucket) {
            throw new Error('User bucket not found')
          }

```

```auto
// Upload to Supabase storage

          const { data: uploadData, error: uploadError } = await supabaseAdmin.storage
            .from(userBucket.bucket_name)
            .upload(storagePath, videoFile, {
              contentType: 'video/mp4',
              upsert: false
            })

          if (uploadError) {
            throw new Error(`Failed to upload video: ${uploadError.message}`)
          }

          console.log('Video uploaded successfully:', uploadData.path)

//Then I get a sigend URL for display on FrontEnd

// Generate signed URL
          const { data: signedUrlData } = await supabaseAdmin.storage
            .from(userBucket.bucket_name)
            .createSignedUrl(storagePath, 3600) // 1 hour expiry

```

The problem is that when I load the signed URL I see that the file on that path is empty

 ![image](https://d3qe71uytubmmx.cloudfront.net/original/3X/3/7/37d79848c859113d3b65fccaee02fa44baf5fa60.png)

Basically I’ve banged my head for the last 4-5 days and tried pretty much everything.

Any help super appreciated! 🙏 🙏

---

<div class="post-metadata">

**Author:** ![Lalit\_Kumar](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/lalit_kumar/32/37058_2.png) [@Lalit\_Kumar](https://discuss.ai.google.dev/u/Lalit_Kumar)\
**Post date:** [August 13, 2025, 9:30am UTC](https://discuss.ai.google.dev/t/cant-download-video-file-ai-files-download-veo-3-model-response/97209/3 "2025-08-13T09:30:00Z")

</div>

Hello,

Could you please try playing the video to check if it was generated correctly? This will help us determine whether the issue is with the generation process or during the download.

---

<div class="post-metadata">

**Author:** ![system](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/system/32/1_2.png) [@system](https://discuss.ai.google.dev/u/system)\
**Post date:** [November 5, 2026, 6:26pm UTC](https://discuss.ai.google.dev/t/cant-download-video-file-ai-files-download-veo-3-model-response/97209/5 "2026-11-05T18:26:13Z")

</div>

Closed on November 5, 2026, 6:26pm UTC

This thread was automatically closed 60 days after the last reply. If you are running into an issue, please create a new post.
