Page 1 of 2
Uploads module, downloads utility: One question and one problem
Posted: Fri Aug 29, 2008 6:53 pm
by yorchotronic
Hello,
As far I red about Downloads on CMSMS they must be done with uploads module.
My question is, is it posible to download files with uploads module which are not uploaded using upload module? Some way to indicate de {cms_module module="Uploads" section to access to a specific link?.This question is relationed with my problem.
I found a piece of code as an example from and old post, I coul not to find any newer code.
Upload section
{cms_module module="Uploads" category="Minutes" mode="upload"}
Download section. In a content page:
{cms_module module="Uploads" category="Minutes" mode="detailed"}
{cms_module module="Uploads" category="Minutes" mode="url"}
To me, the first part of the download section (mode="detailed") look like it works fine, but the second one with mode="url " doesn´t work, send me a message:
Error: Insufficient parameters supplied to module!
I red the help but I dont find any other parameter. I also did read many post about this subject but can´t find some code as
example. A little bit lost...
Maybe you could give me some indications about what is my mistake. Or should I read something else...
I keep triyng.
Thank you
Re: Uploads module, downloads utility: One question and one problem
Posted: Fri Aug 29, 2008 7:52 pm
by Nick Smart
My question is, is it posible to download files with uploads module which are not uploaded using upload module?
I don't think so, as the Uploads module writes to a table when you upload a file.
If you do want to use Uploads to control file downloads then this is one way to use it in order to get links to single files.
You don't have to use it in conjunction with Front End Users and can upload the documents from admin. It has the advantage that you can count the number of downloads.
In Uploads set up a category such as "documents" and create a summary template called "documents" such as:
Code: Select all
<!-- Start Upload Display Template -->
{if isset($input_filter) }
{$startform}
{$prompt_filter}{$input_filter}{$hidden_params}{$input_submit}
{$endform}
<br/>
{$matches} {$matchestext}
{/if}
{foreach from=$items item=entry}
<p>
{$entry->description} - {$entry->summarylink} ({$entry->size}Kb)
</p>
{/foreach}
<!-- End Upload Display Template -->
You can also put an htaccess in the uploads/documents folder to prevent direct linking and downloads - this will force all downloads through the Uploads module and give you an accurate download count:
In your content you need a line like this to show the download link:
Code: Select all
{cms_module module="Uploads" category="documents" mode="singlesummary" upload_id="4" template="documents"}
Replace the id with the appropriate id.
Hope that helps.
Nick
Re: Uploads module, downloads utility: One question and one problem
Posted: Fri Aug 29, 2008 9:35 pm
by jmcgin51
yorchotronic wrote:
My question is, is it posible to download files with uploads module which are not uploaded using upload module?
Yes, this is possible. Upload the file via FTP, etc to the desired directory (typically Uploads/yourdirectory). Then the file will appear in the Uploads admin screen and you can assign a description, thumbnail, etc. Then treat it as a normal Uploads file.
I have to do this with very large files, as the Uploads script times out.
Re: Uploads module, downloads utility: One question and one problem
Posted: Fri Aug 29, 2008 10:40 pm
by yorchotronic
Ok. But with uploads the file must be in uploads tables anyway. I upload an image using an extra field on news module for example. So I get an image on the server on some directory. How could I do the download of that image from the frontend? Other method than mouse-rigth button-save as... over the link
Re: Uploads module, downloads utility: One question and one problem
Posted: Sat Aug 30, 2008 12:45 am
by jmcgin51
yorchotronic wrote:
Ok. But with uploads the file must be in uploads tables anyway.
Kind of. The image itself is not in the db table. The image is stored in a directory on the webserver. Only a reference to it is stored in the db.
yorchotronic wrote:]
I upload an image using an extra field on news module for example. So I get an image on the server on some directory. How could I do the download of that image from the frontend? Other method than mouse-rigth button-save as... over the link
When you do the upload (via News, FTP, or whatever), make sure the file goes to the right directory on the server (the one that Uploads is using. The uploaded file will then be available to use on your site or to make available for download.
Re: Uploads module, downloads utility: One question and one problem
Posted: Sun Aug 31, 2008 5:44 am
by yorchotronic
Hi,
I was working with the information you all give me.
With Nick template and code got run uploads and create a link. But always using a number for the upload_id:
{cms_module module="Uploads" category="documents" mode="singlesummary" upload_id="4" template="documents"}
I can´t get it runn with some thing like this:
upload_id=$entry->id
Ineed to do it in this way beacouse the image attached to the news where I want the upload has that id. Al least it look like is the same that the upload understd with one example I did.
Is any way to do something like that? Is the $entry-id the upload ID of an image uploaded with news and that is in the uploads folder?
Re: Uploads module, downloads utility: One question and one problem
Posted: Sun Aug 31, 2008 6:10 am
by yorchotronic
I´m tryng to use this {cms_module module="Uploads" category="news" mode="singlesummary" upload_id=$id template="documents"} on a detail template news, is it ok?
Re: Uploads module, downloads utility: One question and one problem
Posted: Sun Aug 31, 2008 6:22 am
by Dr.CSS
If you use the Uploads module you can go to the uploadsmod. admin page and use it to upload and use the files from there to offer uploads on your site, you don't need the front end of uploads to get this to work...
Re: Uploads module, downloads utility: One question and one problem
Posted: Sun Aug 31, 2008 6:57 am
by yorchotronic
And how do I link to these images from news admin content.
I have several download files on each new (summarydetail). These documents downloads are differents for each new. I was tryng to use the extra fields on news to upload the files. So I have the content news and the download only using one page for the maintanance. And I got the addres to the file on the news. My only problem is how to use that link to work as a file download.
If the files are uploaded using a different way than news how I do link images and news articles?
So, there is no way to downlod images uploaded without uploads admin or some other upoad method?
Re: Uploads module, downloads utility: One question and one problem
Posted: Sun Aug 31, 2008 9:04 am
by Dr.CSS
Add the download tag to your news template, and I think you can use the news category to make the uploads/downloads particular to the news item you show, like {cms_module module="Uploads" category="{$entry->category}" as long as you have the category in uploads...
Re: Uploads module, downloads utility: One question and one problem
Posted: Sun Aug 31, 2008 9:33 pm
by yorchotronic
Hello Mark,
That code doesn´t work.
Code
{cms_module module="Uploads" category="{$entry->category}" mode="singlesummary" upload_id="4" template="documents"}
Result
QWERT poiuyterewwq 10 congresos_ES
Catchable fatal error: Object of class stdClass could not be converted to string in C:\wamp\www\csierra\CECODE\CONTENDOR EJEMPLOSS\cmsmadesimple - MLE-1.4.1-full\tmp\templates_c\News-ES^%%7E^7E1^7E13DE28%%module_db_tpl%3ANews%3Bdetaildetallececode.php on line 38
Look like a problem about category="{$entry->category}"
Re: Uploads module, downloads utility: One question and one problem
Posted: Mon Sep 01, 2008 2:24 am
by yorchotronic
One thing about all this. Uploads access to all the files on one category excepting if the parameter upload_id is set to some especific value. Is this uploads id the same that the file has as $entry->id (the file is uploaded thru news). The file is in uploads/news folder. But in a subfolder as "id10". How can I reference to a specific file uploaded like this? Not using the id or the name, I´m affraid.
So, no way to do this with CMSMS? On PHP I just use a javascript function to open the link as a download file. Can I do that on CMSMS? Using javascript or using a CMSMS way.
I'll search on tables and will try with de js...
Re: Uploads module, downloads utility: One question and one problem
Posted: Mon Sep 01, 2008 10:49 pm
by yorchotronic
How can I get convert a link to a download link without use uploads?
If isn't possible, How can get vinculate news with files uploaded with uploads?
Re: Uploads module, downloads utility: One question and one problem
Posted: Tue Sep 02, 2008 7:38 am
by yorchotronic
So. look like is not possible to do what I want. Or I do find a way to this with CMSMS or use other way to do the site. Only real problems with this but I need it.
Could it work to do some with php. Uploads use some module to build the link, and then execut it with an event 'download' if I'm not wrog. Maybe I could do more less the same with news and the make the extrafields links downloadble.
Any sugestion? Do I am killing flys with a gun?
Re: Uploads module, downloads utility: One question and one problem
Posted: Wed Nov 05, 2008 12:42 pm
by buntrosgali
guys im trying this module for the first time, i have now got the page where people can upload their photo. But how do i make all the uploads be shown? do i have to do it manually?
the code im using now to enable the user to upload an image is this
{cms_module module="Uploads" category="iamagiant" mode="upload"}
now i want the images to appear on the site alot like thisL
http://iamaranger.rangers.nhl.com/kickapps/service/searchEverything.kickAction?as=20434&mediaType=photo&sortType=recent&tab=yes&includePhoto=on
how do i show the uploaded images like this?
the help with this module is not very clear imo any help is much appriciated. The upload is working, but now how do i show it?
does it have to be done manually?