Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 916397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T18:02:42+00:00 2026-05-15T18:02:42+00:00

I have a scenario where users can upload an image, OR a video (from

  • 0

I have a scenario where users can upload an image, OR a video (from youtube or vimeo) using CCK via ImageField (Images) & Embedded Media Field (Videos)

My site has been using the ImageField images to create thumbnails in various views with imagecache actions.

Youtube/vimeo provide an image capture of the video that I want to use as a “fallback” for the images.

Rather than rewriting each view to provide this fallback, and to keep everything consistent, I was wondering the best route to download and store the external video capture image as if the user uploaded it as an image WITH the video.

I’m familiar with Rules & Actions and PHP, any basic outline of what I should be doing is greaty appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T18:02:43+00:00Added an answer on May 15, 2026 at 6:02 pm

    In hook_nodeapi($op == 'presave', ...) you can check if an image was provided and download it from youtube. A simple solution may be to use drupal_http_request() to download the file then file_save_data() to write it to disk. But this will load the file content in memory which shouldn’t be needed. I think Curl can be used to directly download an HTTP file to disk.

    Downloading the files when nodes are saved my be a performance issue (because it increase response time). In that case, you can delay it to an implementation of hook_cron. You can use the Job Queue to easily enqueue image download for next cron. If running during Drupal’s cron is an issue, you can also try to use the Drupal Queue module to handle downloads separately.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's the scenario: You have a Windows server that users remotely connect to via
I have a scenario where I need to upload a file from one web
I have a scenario where users of my ASP.NET web application submit testimonials consisting
Here's the scenario: We have users login on a secure connection. Could an unathorized
I have a file upload function in my asp.net mvc application that allows users
The scenario is this: I have some users on my site. A user has
I have a scenario where I have to check whether user has already opened
I have a problem regarding getting the path of a user control. The scenario
I have a scenario. (Windows Forms, C#, .NET) There is a main form which
We have a scenario where we want to display a list of items and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.