- Posts: 16
COMMUNITY FORUM
How to add an attachment with an external link
- Dietrich Murphy
- Topic Author
- Offline
- New Member
Less
More
14 years 2 weeks ago #90204
by Dietrich Murphy
How to add an attachment with an external link was created by Dietrich Murphy
I need to add attachments which link to files on another web site. How do i do this with K2?
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 2 weeks ago #90205
by william white
Replied by william white on topic How to add an attachment with an external link
By default k2 saves a copy of the attachment on your server. Simplest way would be to embed an a href tag in the fulltext.
one could create an override if the attachment files are named in a way you could create a link to it with php code and display it in a certain place in the itemview
one could create an override if the attachment files are named in a way you could create a link to it with php code and display it in a certain place in the itemview
Please Log in or Create an account to join the conversation.
- Dietrich Murphy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
14 years 2 weeks ago #90206
by Dietrich Murphy
Replied by Dietrich Murphy on topic How to add an attachment with an external link
I have over 3000 files. I would like to ftp the files to the server and provide links to the files. If I use href tags, K2 will not keep track of the number of downloads. I need to patch the code to support external links.
Please Log in or Create an account to join the conversation.
- Roy Rodenhäuser
- Offline
- New Member
Less
More
- Posts: 1
14 years 1 week ago #90207
by Roy Rodenhäuser
Replied by Roy Rodenhäuser on topic How to add an attachment with an external link
Hi, I'm intersted in this too.
Please Log in or Create an account to join the conversation.
- alp pp
- Offline
- New Member
Less
More
- Posts: 12
14 years 1 week ago #90208
by alp pp
Replied by alp pp on topic How to add an attachment with an external link
i also have the very same problem, the attachments need to be able to have editable links... also a "most popular downloads" would be greeat
Please Log in or Create an account to join the conversation.
- Dietrich Murphy
- Topic Author
- Offline
- New Member
Less
More
- Posts: 16
14 years 1 week ago #90209
by Dietrich Murphy
Replied by Dietrich Murphy on topic How to add an attachment with an external link
Hello! Is anyone there? I have not received a response to may second reply.
Please Log in or Create an account to join the conversation.
- alp pp
- Offline
- New Member
Less
More
- Posts: 12
14 years 1 week ago #90210
by alp pp
Replied by alp pp on topic How to add an attachment with an external link
"files are named in a way you could create a link to it with php code"
how is that possible? writing the code in all file names? if that's possible can you give an example william?
how is that possible? writing the code in all file names? if that's possible can you give an example william?
Please Log in or Create an account to join the conversation.
- alp pp
- Offline
- New Member
Less
More
- Posts: 12
14 years 1 week ago #90211
by alp pp
Replied by alp pp on topic How to add an attachment with an external link
i'm thinking.. how this could be easier than just adding an external link patch?
Please Log in or Create an account to join the conversation.
- william white
- Offline
- Platinum Member
Less
More
- Posts: 3722
14 years 1 week ago #90212
by william white
Replied by william white on topic How to add an attachment with an external link
Sorry for the slow reply as i have been buzy. What i meant by naming the files in a way you could create a link to them with php code, was really having the files named in some way to match say the item title. If this were the case and care was taken to keep out duplicates then you could refer to the attachments in a programmatic way.
I have used this method with names and specific dates before - Doe.John.01/01/1991 which insures uniqueness because the date portion was added - names could be the same but dates of death at least in my table would not be duplicated. Having that, if you problematically create a file called Doe.John.01/01/1991.doc you have a word document you can call up from the table record automatically, and the file will just be there, operators do not have the chance to name the file.
For K2, i think you would have to ftp the files to your server where they are expected to be
Next you would have to populate the jos_k2_attachments table with the proper information which seems to be item id, file name, and title.
You may be able to have a custom tool created to do this, if it were me i would contact
community.getk2.org/profile/ArturNeumann who rote the csv import tool for k2
wjwjr
I have used this method with names and specific dates before - Doe.John.01/01/1991 which insures uniqueness because the date portion was added - names could be the same but dates of death at least in my table would not be duplicated. Having that, if you problematically create a file called Doe.John.01/01/1991.doc you have a word document you can call up from the table record automatically, and the file will just be there, operators do not have the chance to name the file.
For K2, i think you would have to ftp the files to your server where they are expected to be
Next you would have to populate the jos_k2_attachments table with the proper information which seems to be item id, file name, and title.
You may be able to have a custom tool created to do this, if it were me i would contact
community.getk2.org/profile/ArturNeumann who rote the csv import tool for k2
wjwjr
Please Log in or Create an account to join the conversation.
- alp pp
- Offline
- New Member
Less
More
- Posts: 12
14 years 1 week ago #90213
by alp pp
Replied by alp pp on topic How to add an attachment with an external link
thanks for your answer william...
well in my point duplicates is no problem. it will be download directory, and there may be more than one attachments (links to remote file) then one. i mean how can you do it with the " file name" solution? i'm not a programmer and i do not know how to do it.
as a result, if i do it using some attachments' names to a link (which sounds hacky) i will not have any chances for user submission to the download directory? it will also be very very time consuming to arrange files names, instead of writing the web address in a single line. i used the "link title attribute" as a weblink input. it worked fine for the download, but failed to count the downloads. which is essential for a download directory.
anyway, i do believe that the remote link should be possible through a single line in both back and front end submissions, and a "hits counter" option should be available for any field (ie: website links) in jseblod and sobi2 this feature is already available.
well in my point duplicates is no problem. it will be download directory, and there may be more than one attachments (links to remote file) then one. i mean how can you do it with the " file name" solution? i'm not a programmer and i do not know how to do it.
as a result, if i do it using some attachments' names to a link (which sounds hacky) i will not have any chances for user submission to the download directory? it will also be very very time consuming to arrange files names, instead of writing the web address in a single line. i used the "link title attribute" as a weblink input. it worked fine for the download, but failed to count the downloads. which is essential for a download directory.
anyway, i do believe that the remote link should be possible through a single line in both back and front end submissions, and a "hits counter" option should be available for any field (ie: website links) in jseblod and sobi2 this feature is already available.
Please Log in or Create an account to join the conversation.