- Posts: 6
COMMUNITY FORUM
K2 attachment using cloud storage
- Vincent Murphy
-
Topic Author
- Offline
- New Member
Wondering if anybody knows of a method to integrate amazon S3 storage with K2 attachments. I have a large volume of attachments which I'd like to store using the S3 service but I need to integrate it with my K2 item maintenance. Don't want to reinvent the wheel if something already exists.
Thanks.
Please Log in or Create an account to join the conversation.
- william white
-
- Offline
- Platinum Member
- Posts: 3722
Please Log in or Create an account to join the conversation.
- Vincent Murphy
-
Topic Author
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Case Noland
-
- Offline
- Junior Member
- Posts: 25
<<SEE ATTACHED .TXT FILE FOR CODE>>
Now your title attribute is the full URL to your download. If using Amazon S3 be sure to set proper ACL privileges.
You will still need to upload some sort of dummy file (empty txt doc, etc.) which is why it's hacky.
I also updated the language file to make the new functionality more apparent to other users.
Hope this helps,
Case
Please Log in or Create an account to join the conversation.
- Vincent Murphy
-
Topic Author
- Offline
- New Member
- Posts: 6
Case said:I do this in a slightly hack-ish way but it works great. Script file attached.
SEE ATTACHED .TXT FILE FOR CODE>>
Now your title attribute is the full URL to your download. If using Amazon S3 be sure to set proper ACL privileges.
You will still need to upload some sort of dummy file (empty txt doc, etc.) which is why it's hacky.
I also updated the language file to make the new functionality more apparent to other users.
Hope this helps,
Case
Please Log in or Create an account to join the conversation.
- alp pp
-
- Offline
- New Member
- Posts: 12
i guess you miscopied the replacement with the original code... anyway, i somehow guessed & managed to change the code (see text attachment) it worked perfectly for the external url's.
it's great to have external links inside k2, and your post was very helpful for me to see from where it could be done... thank you indeed...
Please Log in or Create an account to join the conversation.
- Joseph Cotten
-
- Offline
- New Member
- Posts: 5
So, if I replace the code you listed from item.php with the new code you attached to this thread, what's my next step?
I have mp3 files on my Amazon S3 space, and I want to attach them to K2 Items. Right now I'm using the JoomlaWorks AllVideos plugin to display the remote mp3s. So, how can I get K2 to display those remote mp3s via the K2 Attachments field?
Please Log in or Create an account to join the conversation.
- Case Noland
-
- Offline
- Junior Member
- Posts: 25
In this way you can use the HTTP URLs from your S3 account and still have the simple K2 input form and ability to turn it on/off in various locations/templates.
As I mentioned previously, I also updated the K2 language file to ensure K2 users with editing privileges knew what information to put in each box.
You'll also need to ensure your S3 ACL settings have read access for public users enabled.
Please Log in or Create an account to join the conversation.
- alp pp
-
- Offline
- New Member
- Posts: 12
Please Log in or Create an account to join the conversation.
- Joseph Cotten
-
- Offline
- New Member
- Posts: 5
When you say “Title Attribute” are you talking about the field that appears when you Add an Attachment to a K2 Item?
A scenario: I have an audio file of a message. I want to store the audio file on my Amazon space. So, I create a new K2 Item called “My Message”, upload the audio mp3 to my amazon space—let's say it's at files.amazon.com/my_message.mp3—then in the K2 Item, I Add an Attachment. See my image and let me know if I'm thinking correctly about this.
Please Log in or Create an account to join the conversation.
- alp pp
-
- Offline
- New Member
- Posts: 12
Please Log in or Create an account to join the conversation.
- Case Noland
-
- Offline
- Junior Member
- Posts: 25
At any rate, you can simply upload an empty text file or similar tiny file to satisfy K2 (or modify code not to require it)
The 'Attribute' is the link to the file on S3 and when someone clicks the Link title it will now pull from S3, not from K2.
alp is right, download counter will not function without further modification.
Please Log in or Create an account to join the conversation.
- alp pp
-
- Offline
- New Member
- Posts: 12
Please Log in or Create an account to join the conversation.