Search

I'm building a website for an audio podcast and need the user to be able to upload MP3 files to their media hosting account. The workflow will be:

  1. User uploads a file from their hard drive
  2. Symphony extracts the file's name, size and duration (for the RSS feed)
  3. The file is FTP'ed to a remote server
  4. If all goes well, the file details from step 2 are saved in a Symphony Section

I created a simple PHP page that handles the first three steps using Uploadify and getID3. What's the easiest way to integrate this into Symphony?

I initially thought it would require a custom field type in my Section. Now I'm thinking that a Symphony page with a file upload form plus a custom event to populate the Section would be better. The downside is that the page would be outside the normal admin environment. But I could at least set the page type to 'admin' so that it was only accessible to logged-in users.

I thought I'd check with the forum first just to make sure I'm not overlooking an easier way to achieve this. I had a look through the extensions but didn't see anything obvious.

What about something like Filepicker.io?

This would potentially alleviate a lot of the heavy lifting.

I started work on a field type called FilePicker that I'm testing at the moment and it seems to work pretty well.. what it means is that your client can add a file to a section entry and pick a file from a service or upload to an S3 bucket for speedy retrieval maybe?

Anyways, here's the repo I've started: https://github.com/andrewminton/filepickerfield

P.S not sure about the metadata stuff yet.. it just reflects the uploaded url into an input field in the section right now..

I need to upload a file to a particular remote server via FTP. I don't think filepicker.io does that, does it? Looks like it uses Amazon S3 for storage.

In any case, the heavy lifting is already taken care of by uploadify. My question is how best to integrate this workflow into Symphony.

Appologies.. missunderstood question.. A backebd symphony page that can be built via an extension is the best approach then.

Trying to think of an extenion you could look at for reference.

There is an extensin called reflected upload field.. wondering if this could be adapted to show the ftp files in order to select the file to insert into the section entry?

I'm not selecting files from a server, I'm sending files to a server. I need an admin page (backend or frontend) where the user can choose a file from their hard drive and upload it to the media hosting server via FTP. Along the way I'll be pulling metadata from the file and storing it in a Symphony Section for later use.

Does Symphony need the absolute URL of the file being uploaded to the FTP file server or just the filename?

If I understand the requirements from populating a section entry correctly, you want the file that has been uploaded to the FTP server to reflect it's values to populate a section entry right?

Symphony only needs to store the filenames as the path to the files on the remote server will always be the same. I also need to store the filesize and duration to use in the RSS feed.

What I have currently is:

  • a Section to store the filename, filesize and duration
  • a Page which is just a simple form that contains an input field of type 'file'
  • an Event that is attached to the Page and publishes to the Section

In my event's load() function I added code to FTP the uploaded temp file to the remote server. If the transfer is successful I pull the metadata I need from the $FILES array and the ID3 info and populate the $POST array with it. Finally, I call __trigger() to create a new Section entry.

This seems to work. I'm just not sure whether it's the correct way to go about it. Maybe there's another approach that is more Symphony-like. That's what I'm after - the best practice solution for this use-case.

To be honest, you're approach sounds ideal.

The validation is being handled and triggered to the user by the event I'm guessing?

i.e. if the FTP fails or is interrupted?

Yes, the validation takes place in the load() function.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details