Forums

Content Submit With Attachment

psamim 25 May, 2009
Hi All
Is it possible that insert a upload file in the content submit form that users can attach files to contents?
Thank you!
GreyHead 26 May, 2009
Hi psamim,

You'd need to include a link to the uploaded file into one of the content text areas.

If I remember correctly someone posted how to do this a month or two ago.

Bob
psamim 27 May, 2009
I added a "upload file" to the content submit package. It uploads files and posts article, bt how can I make it to insert a link to the uploaded file inside the article?
Max_admin 27 May, 2009
Hi psamim,

you may grab the file link as in the other post and then use the code below to attach the file link at the bottom of the article:


<?php
$file_link = 'http://www.domain.com/components/com_chronocontact/uploads/form_name/'.JRequest::getVar("file_field_name");
JRequest::setVar("fulltext", JRequest::getVar("fulltext")."<br><br>".$file_link);
?>


the code above goes in the onsubmit after email box!

Cheers
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
psamim 28 May, 2009
Thank you very much!
The only problem is that numbers are in my default language, Farsi, so the address is incorrect. I don't know what to do but I will search for a solution. Thank you again!
Max_admin 01 Jun, 2009
Hi,

The only problem is that numbers are in my default language,



what does this mean ?

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
psamim 01 Jun, 2009
I mean the form saves the file as : 20090405sample.zip
But when saved the numbers are shown in Arabic, so the link does not work.
Max_admin 05 Jun, 2009
Hi psamim,

Ok, in RC5.1 there is a variable to change the file name under the file uploads tab, change it so that it doesn't include the date and this will solve your problem, make sure you replace it with something to make the file name unique though.

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.