Need Some Help w/Custom form fields in content creation.

robotsguide - July 30, 2009 - 20:33

I'm trying to find a way to have a custom form field in content creation that will allow someone to upload a file. I'm using the drupal core "upload" module, but here's the catch: I need the file to be uploaded to a CDN server, and not to my drupal site's server. I also need this same field to rename the file and pass a php variable to be put through on the created content page .

example:

file user wants to upload: movie.flv

the field would automatically rename this to: username_movie.flv (where 'username' is the user's log in name)

the file would be uploaded to my CDN, and not the sever drupal is on.

the field would also pass the file's name as the php variable $filename on the content page.

I'm a little lost with this. I have an idea on what I need to do, I just need help getting started.

A couple ideas

nolimitsdude - August 4, 2009 - 15:31

If your CDN has an upload feature that would work, you could use and IFRAME tag to make a window on your page that will allow you to use the CDN tools to load the files to the CDN server.

Otherwise I could see loading a temp file to your drupal server and then doing a transfer to the CDN server and then deleting the file.

I am looking for drupal projects let me know if I can help out nolimitsdude@gmail.com

nolimitsdude

I finally figured this out. I

robotsguide - August 12, 2009 - 23:13

I finally figured this out. I used CCK filefield and media_mover to get the job done.

 
 

Drupal is a registered trademark of Dries Buytaert.