This topic is locked

File Upload - Don't want Filename field to show

1/4/2008 1:27:15 PM
PHPRunner General questions
T
tototoo author

My users need to be able to upload and later view PDF files. Uploading and viewing the file works great as long as I have a field defined to store the filename. Without that, the file was stored as type bin, which is problematic for my users, since they can't just click on it to display the file. The Browse button is great, but the associated Filename field is going to confuse the heck out of them. How can I make it invisible?

A
alang 1/6/2008

You do need to have the filename field but you don't need to display it explicitly on the list/add/edit views - uncheck the filename field on the "choose fields" tab.

T
tototoo author 1/7/2008

You do need to have the filename field but you don't need to display it explicitly on the list/add/edit views - uncheck the filename field on the "choose fields" tab.


Thanks, but that doesn't work. The field does not appear on any of the lists or page layouts in PHPRunner. But, it is on the finished pages. It also has the label 'Filename', which I didn't enter. Any other thoughts, anyone?

J
Jane 1/9/2008

Hi,
to remove Fieldname input edit BuildEditControl function in the generated include/commonfunctions.php file.

Here is a sample code in Bold:

$strfilename='
'."Filename".'&nbsp;&nbsp;<input type=hidden name="filename'.$cfieldname.'" size="20" maxlength="50" value="'.htmlspecialchars($filename).'">';

$onchangefile.="var path=this.form.elements['".jsreplace($cfield)."'].value; var wpos=path.lastIndexOf('\\\\'); var upos=path.lastIndexOf('/'); var pos=wpos; if(upos>wpos) pos=upos; this.form.elements['filename".jsreplace($cfieldname)."'].value=path.substr(pos+1);";