hello,
i would like the entry in the database for the file upload to show as a url, so that when retrieving the data later, there is a hyperlink to that file
currently, the name of the file is shown in the database and the location of the file itself is in the uploads folder of chronocontact
can you advise on what changes to make to the html for this to happen
currently:
<div class="form_item">
<div class="form_element cf_fileupload">
<label class="cf_label">CV</label>
<input class="cf_fileinput" size="20" id="file_0" name="cv" type="file" />
</div>
thanks in advance
Matt
i would like the entry in the database for the file upload to show as a url, so that when retrieving the data later, there is a hyperlink to that file
currently, the name of the file is shown in the database and the location of the file itself is in the uploads folder of chronocontact
can you advise on what changes to make to the html for this to happen
currently:
<div class="form_item">
<div class="form_element cf_fileupload">
<label class="cf_label">CV</label>
<input class="cf_fileinput" size="20" id="file_0" name="cv" type="file" />
</div>
thanks in advance
Matt
Thanks
I'm almost there on my test site - only trouble is I am getting a strange URL, duplicating folders and going into my home directory (the file label is called cv):
This is the code I put in: <?PHP
JRequest::setVar('cv', 'http://www.etax.co.uk/components/com_chronocontact/uploads/testuploading/'.$attachments['cv']);
?>
And this is a sample from the database file (ignore opening quotes to avoid long hyperlink):
"http://www.etax.co.uk/components/com_chronocontact/uploads/testuploading//home/etax/public_html/components/com_chronocontact/uploads/testuploading/20090311163106_cook.doc
Cheers
Matt
I'm almost there on my test site - only trouble is I am getting a strange URL, duplicating folders and going into my home directory (the file label is called cv):
This is the code I put in: <?PHP
JRequest::setVar('cv', 'http://www.etax.co.uk/components/com_chronocontact/uploads/testuploading/'.$attachments['cv']);
?>
And this is a sample from the database file (ignore opening quotes to avoid long hyperlink):
"http://www.etax.co.uk/components/com_chronocontact/uploads/testuploading//home/etax/public_html/components/com_chronocontact/uploads/testuploading/20090311163106_cook.doc
Cheers
Matt
Hi,
try to replace:
by:
Cheers
Max
try to replace:
$attachments['cv']
by:
$_FILES['cv']['name']
Cheers
Max
almost there:
I am getting"http://www.etax.co.uk/components/com_chronocontact/uploads/TESTUP2NOREG/enquiry.doc
missing the autogenerated prefix such as 20090312151126_enquiry.doc
so the hlink still incorrect
thanks
Matt
(will be buying license for my real site shortly, once I have mastered things!!)
I am getting"http://www.etax.co.uk/components/com_chronocontact/uploads/TESTUP2NOREG/enquiry.doc
missing the autogenerated prefix such as 20090312151126_enquiry.doc
so the hlink still incorrect
thanks
Matt
(will be buying license for my real site shortly, once I have mastered things!!)
Hi Matt,
Looks as though $attachments has a path and you need a url. We worked through this in a thread on renaming images a month or two ago - all the code is in the forums somehwere.
Bob
Looks as though $attachments has a path and you need a url. We worked through this in a thread on renaming images a month or two ago - all the code is in the forums somehwere.
Bob
Hi Matt,
try this:
Max
try this:
JRequest::setVar('cv', 'http://www.etax.co.uk/'.str_replace(JPATH_SITE, '', $attachments['cv']));
Max
This topic is locked and no more replies can be posted.