You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
We recently uploaded all of our member MoU documents into the member document store, replacing the original
ugly filenames like "Signed_memo_2016_v2.pdf" with something nicer and more descriptive like "Member MoU"
Unfortunately it's not obvious in the interface that the "Name" field is also used to generate the download filename, so
if it's not entered as "Member MoU.pdf" then the file doesn't download correctly as the browser doesn't know what to do with it.
I've just noticed that there is explanatory text under this field, but this only appears when you click the "Help" button.
Describe the solution you'd like
A note/warning under the "Name" field that this must contain the file extension
and/or If the name does not contain the file extension of the filename uploaded, warn and/or fix this automatically
Additional context
My simple script to fix broken filenames:
#!/usr/bin/perl
use strict;
use DBI;
# <robl> 2020-11-13
# Turns out that the "Name" in the docstore is used at the filename.
# If it doesn't end in .pdf, the file doesn't download correctly.
# Fix up any name that doesn't end in .pdf that should be .pdf
my $MYSQL_DATABASE = 'ixpmanager';
my $MYSQL_SERVER = 'localhost';
my $MYSQL_USER = 'ixpm_db_user';
my $MYSQL_PASS = 'ixpm_db_pass';
my $MYSQL_DATA_SOURCE = "dbi:mysql:$MYSQL_DATABASE:$MYSQL_SERVER";
my $dbh_db = DBI->connect($MYSQL_DATA_SOURCE, $MYSQL_USER, $MYSQL_PASS, {
RaiseError => 1,
PrintError => 1,
# AutoCommit => 0,
}) or die "Can't connect to mysql db $MYSQL_DATABASE / $MYSQL_SERVER : $DBI::errstr";
my $sth = $dbh_db->prepare("SELECT id, name, path FROM docstore_customer_files
WHERE
name NOT LIKE '%.pdf' AND
path LIKE '%.pdf'
") or die "Can't prepare statement: $DBI::errstr";
$sth->execute( );
while (my $row = $sth->fetchrow_hashref) {
print "id -> $row->{id} name -> $row->{name}\n";
&set_name($row->{id},$row->{name} . '.pdf');
}
sub set_name {
my ($id,$name) = @_;
return 0 unless ($id);
return 0 unless ($name);
my $sql = "UPDATE docstore_customer_files
SET name = ?
WHERE id = ?";
my $sth = $dbh_db->prepare($sql);
$sth->execute($name, $id);
}
The text was updated successfully, but these errors were encountered:
A follow up to: inex#686
Users still seem to be uploading files without extensions, by typing something in the "Name" field, not realising this is used as the actual file name.
Possibly because this is the first field, and it's before the file upload button. If name is not completed, the filename is completed automatically.
File then won't open when downloaded because it has no extension.
- This fix changes "Name" to "File Name" to make it more obvious.
- Validate the file name is "(something).extn"
- Move upload file button before File Name so the user does this bit first. (Then will see the name is filled in for them.)
Can't see a way to make the help text visible by default (it's hidden unless the user clicks the help button.)
Is your feature request related to a problem? Please describe.
We recently uploaded all of our member MoU documents into the member document store, replacing the original
ugly filenames like "Signed_memo_2016_v2.pdf" with something nicer and more descriptive like "Member MoU"
Unfortunately it's not obvious in the interface that the "Name" field is also used to generate the download filename, so
if it's not entered as "Member MoU.pdf" then the file doesn't download correctly as the browser doesn't know what to do with it.
I've just noticed that there is explanatory text under this field, but this only appears when you click the "Help" button.
Describe the solution you'd like
Additional context
My simple script to fix broken filenames:
The text was updated successfully, but these errors were encountered: