Table link to uploaded file

Shows some Tutorials

Table link to uploaded file

Postby jberryhill on Wed May 28, 2008 4:43 pm

Hi Everyone. Hopefully this wasn't covered elsewhere. I did a search and couldn't find anything. I am using the latest version of ChronoForms for Joomla 1.5. I am creating an online job application with an option to upload a resume. Everything is working fine except I would like for a link to the uploaded file to appear on the data table. As it is now, nothing shows up on the table under resume. Hopefully I am explaining this correctly. Any help would be appreciated.

Thanks
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby GreyHead on Wed May 28, 2008 4:53 pm

Hi jberryhill,

Try this post

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3410
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Table link to uploaded file

Postby jberryhill on Wed May 28, 2008 8:30 pm

Thank you for your quick response. I have looked through the conversation that you sent me to but was unable to find what I need to do to have a link to the uploaded file listed in the table. The email attachments are sending find, and I have fixed the redirect error, but I am unable to get anything to show up on the table.
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby GreyHead on Wed May 28, 2008 8:37 pm

Hi jberryhill,

In the Autogenerated tab for your form try replacing
Code: Select all
$_POST['file_name']
with
Code: Select all
$_FILES[$allowed_s2[0]]['name']
it may vary depending on your Joomla version.

What do you see with DeBug on?

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3410
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Table link to uploaded file

Postby jberryhill on Wed May 28, 2008 8:47 pm

I have looked through the Autogenerated tab coding and i don't have the $_post tag to replace. I just have an entry for each of my form area names:
Code: Select all
('resume','', 'post', 'string', '' )."');" );
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby jberryhill on Wed May 28, 2008 8:50 pm

I forgot to mention, the upload section doesnt show up in the debug section in the "_POST: Array" section.
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby GreyHead on Wed May 28, 2008 9:06 pm

Hi jberryhill,

In full that's like:
Code: Select all
'".JRequest::getVar('resume','', 'post', 'string', '' )."' ,
so you are using Joomla 1.5, in which case the code is different. Try replacing the whole of that statement with
Code: Select all
'".$_FILES[$allowed_s2[0]]['name']."' ,
If that doesn't work I shall need to go and search some more.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3410
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Table link to uploaded file

Postby jberryhill on Wed May 28, 2008 9:56 pm

I made the change and it didn't work. I tinkered around with it for a bit and haven't gotten it functioning. When I made the change, the email attachments still worked but chronoforms completely stopped saving data to the table. I appreciate your help!
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby GreyHead on Thu May 29, 2008 12:06 pm

Hi jberryhill,

Most likey you have a small typo on the page. If you post it here between [code] tags I'll take a look.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3410
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Table link to uploaded file

Postby jberryhill on Thu May 29, 2008 12:36 pm

Autogenerated Coding:
Code: Select all
<?php
   $database =& JFactory::getDBO();
   srand((double)microtime()*10000);
   $inum   =   "I" . substr(base64_encode(md5(rand())), 0, 16);
   
$database->setQuery( "INSERT INTO #__chronoforms_1 VALUES  (
'' ,
'".$inum."','". date('Y-m-d')." - ".date("H:i:s")."',
'".$_SERVER['REMOTE_ADDR']."' ,
'".JRequest::getVar('position','', 'post', 'string', '' )."' ,
'".JRequest::getVar('learnaboutus','', 'post', 'string', '' )."' ,
'".JRequest::getVar('learnaboutusother','', 'post', 'string', '' )."' ,
'".JRequest::getVar('fname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('lname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('email','', 'post', 'string', '' )."' ,
'".JRequest::getVar('mname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('city','', 'post', 'string', '' )."' ,
'".JRequest::getVar('state','', 'post', 'string', '' )."' ,
'".JRequest::getVar('zip','', 'post', 'string', '' )."' ,
'".JRequest::getVar('phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('ccn','', 'post', 'string', '' )."' ,
'".JRequest::getVar('appliedbefore','', 'post', 'string', '' )."' ,
'".JRequest::getVar('poofofeligibility','', 'post', 'string', '' )."' ,
'".JRequest::getVar('previouslyapplieddate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employedbefore','', 'post', 'string', '' )."' ,
'".JRequest::getVar('previouslyemployeddate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('friendsrelativesworkhere','', 'post', 'string', '' )."' ,
'".JRequest::getVar('currentlyemployed','', 'post', 'string', '' )."' ,
'".JRequest::getVar('preventedlawfullyemployed','', 'post', 'string', '' )."' ,
'".JRequest::getVar('proofofcitizenshipimmigration','', 'post', 'string', '' )."' ,
'".JRequest::getVar('dateavailable','', 'post', 'string', '' )."' ,
'".JRequest::getVar('abletowork','', 'post', 'string', '' )."' ,
'".JRequest::getVar('subjecttorecall','', 'post', 'string', '' )."' ,
'".JRequest::getVar('abletotravel','', 'post', 'string', '' )."' ,
'".JRequest::getVar('elementaryname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('elementaryaddress','', 'post', 'string', '' )."' ,
'".JRequest::getVar('elemtaryyears','', 'post', 'string', '' )."' ,
'".JRequest::getVar('highschoolname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('highschooladdress','', 'post', 'string', '' )."' ,
'".JRequest::getVar('highschoolyears','', 'post', 'string', '' )."' ,
'".JRequest::getVar('undergradname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('undergradaddress','', 'post', 'string', '' )."' ,
'".JRequest::getVar('undergradmajor','', 'post', 'string', '' )."' ,
'".JRequest::getVar('undergradyears','', 'post', 'string', '' )."' ,
'".JRequest::getVar('undergraddegree','', 'post', 'string', '' )."' ,
'".JRequest::getVar('gradname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('gradaddress','', 'post', 'string', '' )."' ,
'".JRequest::getVar('gradmajor','', 'post', 'string', '' )."' ,
'".JRequest::getVar('gradyears','', 'post', 'string', '' )."' ,
'".JRequest::getVar('graddegree','', 'post', 'string', '' )."' ,
'".JRequest::getVar('othereducationname','', 'post', 'string', '' )."' ,
'".JRequest::getVar('othereducationaddress','', 'post', 'string', '' )."' ,
'".JRequest::getVar('othereducationcourseofstudy','', 'post', 'string', '' )."' ,
'".JRequest::getVar('othereducationyears','', 'post', 'string', '' )."' ,
'".JRequest::getVar('othereducationdegree','', 'post', 'string', '' )."' ,
'".JRequest::getVar('othereducationadditionalcomments','', 'post', 'string', '' )."' ,
'".JRequest::getVar('extras','', 'post', 'string', '' )."' ,
'".JRequest::getVar('military','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1jobtitle','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1supervisor','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1startdate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1enddate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1startingsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1finalsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment1workperformed','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2jobtitle','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2supervisor','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2startdate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2enddate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2startingsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2finalsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment2workperformed','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employmen31','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3jobtitle','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3supervisor','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3startdate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3enddate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3startingsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3finalsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment3workperformed','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4jobtitle','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4supervisor','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4startdate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4enddate','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4startingsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4finalsalary','', 'post', 'string', '' )."' ,
'".JRequest::getVar('employment4workperformed','', 'post', 'string', '' )."' ,
'".JRequest::getVar('activitiesandoffices','', 'post', 'string', '' )."' ,
'".JRequest::getVar('summarizedjobskills','', 'post', 'string', '' )."' ,
'".JRequest::getVar('additionalinfo','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference1name','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference1phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference1address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference1relationship','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference2name','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference2phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference2address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference2relationship','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference3name','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference3phone','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference3address','', 'post', 'string', '' )."' ,
'".JRequest::getVar('reference3relationship','', 'post', 'string', '' )."' , '"

'".$_FILES[$allowed_s2[0]]['name']."' ,

if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>

Maybe it should look different because its the last form object?
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby GreyHead on Thu May 29, 2008 12:50 pm

Hi jberryhill,

Try this in place of the last two lines of the SQL:
Code: Select all
'".JRequest::getVar('reference3relationship','', 'post', 'string', '' )."' ,
'".$_FILES[$allowed_s2[0]]['name']."');" );
Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3410
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany

Re:Table link to uploaded file

Postby jberryhill on Thu May 29, 2008 1:54 pm

Almost got it. I changed it just a bit and used the code below. I am trying to make the table output a clickable link. Do i need to do this differently than regular html? When i tried to add a link tag it did not work properly.

Code: Select all
'".$filename."');" );
jberryhill
Fresh Boarder
 
Posts: 7
Joined: Wed May 28, 2008 4:29 pm

Re:Table link to uploaded file

Postby GreyHead on Thu May 29, 2008 4:36 pm

Hi jberryhill,

Personally, I'd save the url, possibly just the filename, in the database and then build the link when I needed it.

Bob
Bob Janes
info at greyhead.net
ChronoForms Support If you like ChronoForms please vote or post a review at Joomla.org
User avatar
GreyHead
Platinum Boarder
 
Posts: 3410
Joined: Tue May 29, 2007 10:15 pm
Location: Brittany


Return to ChronoForms How To

Who is online

Users browsing this forum: No registered users and 2 guests