Currently FeedAPI/ParserCSV only support pulling CSV files from the web. It should also support a file upload.

Comments

scottrigby’s picture

Component: Code » User interface

Hi alex_b,
The path of the file upload can already be pasted into the Feed URL field. This could be added as an option on the node edit form, and present a select list of current file uploads for that node (then use the same back-end, using the URL from the selected file upload). What do you think?

alex_b’s picture

I think it should be a full fledged upload.

Adding the select list you're talking about is a very specific use case and easy to do in a custom module - I'd rather not wire it into the module.

alex_b’s picture

Project: CSV Parser » FeedAPI

This is actually a FeedAPI issue.

jweberg’s picture

subscribe

I am using FlashVideo and need to upload files from feeds with this.

aron novak’s picture

Wait a second! FeedAPI is for handling feeds. It has nothing to do with local files.
However I can imagine such a module which is able to handle this transparently for you. A file upload popup form what copies the result url into the feedapi url field.
I do not think FeedAPI core should handle file uploads.

jweberg’s picture

Maybe it would fit in to the FeedAPI Element Mapper project though. To be able to take 'podcasts' and upload the media files to flashvideo or similar would be a great feature. I know that I need something like this for one of my sites now. I don't know if the mapper could incorporate this or not but I think it could have many uses.

scottrigby’s picture

Not a CSV Parser issue – since this module is specifically for parsing files?

alex_b’s picture

#5:

I think there's a valid use cases where you'd like to load a feed from your local disk onto your web site. Think of CSV or iCal, think of testing or migration.

From this perspective, I think that file upload could live in FeedAPI core. But for argument's sake: Could such an upload feature live in an add-on module?

aron novak’s picture

alex_b: It's not hard to imagine such an add-on module what provides a pop-up with a file upload only form and generates an URL from the uploaded file.

jweberg’s picture

I think alot of us were also thinking of uploading from podcasts and the such as well.

alex_b’s picture

Assigned: Unassigned » aron novak

This can be an add on module (feedapi_fileupload) that adds an upload field next to the url field on the form. On submission, it uploads the file to Drupal's file directory and sticks the URL to the file onto $node->feed->url .

aron novak’s picture

StatusFileSize
new817 bytes
aron novak’s picture

Status: Active » Needs review
alex_b’s picture

Status: Needs review » Needs work
StatusFileSize
new40.19 KB

Hi Aron - just had a look. This is a funny brief module :-)

It's functional, but I'd like to suggest a more solid approach:

* Create a separate upload field, don't hijack file attachments.
* Don't rely on JavaScript.
* Embed upload field right under the URL field (see attachment).
* Roll as a patch to FeedAPI. I think we should include it in the package.

aron novak’s picture

StatusFileSize
new3.25 KB
aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new3.1 KB

This version allows to replace existing URLs with upload also.

alex_b’s picture

StatusFileSize
new6.04 KB

Looking good. I added a setting on content type form for choosing whether to use file upload or not on a per content type basis.

alex_b’s picture

StatusFileSize
new6.19 KB

Stores feeds in files/feeds/ .

alex_b’s picture

Status: Needs review » Needs work
StatusFileSize
new1.41 KB

There shouldn't be extra validation for whether a file is present. Like before, it should be still possible to submit a feed node without specifying a URL (this behavior is questionable, but let's not change it with this patch anyhow) - this is fixed.

Found another problem: upload does not work if attachments are not enabled on content type.

aron novak’s picture

StatusFileSize
new6.46 KB

Here is a patch what makes the stuff work in every case (if upload module is disabled, for example)

aron novak’s picture

Status: Needs work » Needs review
aron novak’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.