Hi,
I need a solution to be able to re-upload a file after it has been submitted once.
This is my case:
I have a form where people can apply for jobs. In this form they upload a file (e.g. MsWord doc) which is being stored. They need to be able to replace the file.
I tried with CC (ChronoConnectivity), but nothing happens when I try to edit the record and upload a file again. Also CC doesn't handle the file-location.
I also tried making a seperate Form in CF (ChronoForms) which gets a variable to indentify the record which has to be updated and enables to upload a new letter:
Form code:
2 problems:
1.No file is being upload (although all form-settings for file-upload are ok), but is a minor problem right now..
2.Main problem is that also a new record is being made in the DB. And this I don't want. I only want to update the record-field 'vac_pdf' and upload a new file.
So I think my solution would be to make a simple php-form myself just for uploading a file and make a script in which the name of the file (which is being saved in the record the first time) is being updated with the new name.
Form code:
Where upload.php contains:
Is there a way to do this, in a simple way, with CF?
Thnx,Robin
I need a solution to be able to re-upload a file after it has been submitted once.
This is my case:
I have a form where people can apply for jobs. In this form they upload a file (e.g. MsWord doc) which is being stored. They need to be able to replace the file.
I tried with CC (ChronoConnectivity), but nothing happens when I try to edit the record and upload a file again. Also CC doesn't handle the file-location.
I also tried making a seperate Form in CF (ChronoForms) which gets a variable to indentify the record which has to be updated and enables to upload a new letter:
Form code:
<?php
$v_vacnr = &JRequest::getVar('vac_nr', '', 'GET');
$db =&JFactory::getDBO();
$query = "SELECT * FROM jos_chronoforms_lincavac
WHERE vac_nr = '$v_vacnr'";
$db->setQuery($query);
$rows = $db->loadObject();
?>
<table>
<tr> /*show if it is the right record we are updating*/
<td>Vacature nummer</td><td><?php echo "$rows->vac_nr" ?></td>
</tr>
<tr>
<td>Upload Vacature-PDF/Doc</td>
<td ><input name="vac_pdf" id="vac_pdf" type="file" /></td>
</tr>
</table>
<button type="submit" >verstuur</button>
2 problems:
1.No file is being upload (although all form-settings for file-upload are ok), but is a minor problem right now..
2.Main problem is that also a new record is being made in the DB. And this I don't want. I only want to update the record-field 'vac_pdf' and upload a new file.
So I think my solution would be to make a simple php-form myself just for uploading a file and make a script in which the name of the file (which is being saved in the record the first time) is being updated with the new name.
Form code:
<?php
$v_vacnr = &JRequest::getVar('vac_nr', '', 'GET');
$db =&JFactory::getDBO();
$query = "SELECT * FROM jos_chronoforms_lincavac
WHERE vac_nr = '$v_vacnr'";
$db->setQuery($query);
$rows = $db->loadObject();
?>
<form enctype="multipart/form-data" action="upload.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
New file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
Where upload.php contains:
$target_path = "../uploads/"; /* define the target path her*/
$target_path = $target_path . basename( $_FILES['uploadedfile']['name']); /* store file */
...some code to replace field 'vac_pdf' with '$_FILES['uploadedfile']['name']'......
Is there a way to do this, in a simple way, with CF?
Thnx,Robin