I just started experiencing an error with a File Browse item and I'm not sure if Apex has always been doing this and I've just now noticed, or if it's changed behavior. When the file being uploaded exists on a network location, the full path -- backslashes included -- is being put in the apex_application_files.filename column. The backslashes are causing me problems further down the line.
Here's what I get when the file is uploaded from a local directory, which is what I expect:
print_table( 'select id, name, filename from apex_application_files where id = 45206188158037871' );
ID : 45206188158037871
NAME : 45206188158037871/Lorem Ipsum.txt
FILENAME : Lorem Ipsum.txt
Here's what I get when the file is uploaded from a network location, which is weird:
print_table( 'select id, name, filename from apex_application_files where id = 45204261421976369' );
ID : 45204261421976369
NAME : 45204261421976369/\\<network location>\My Documents\Lorem Ipsum.txt
FILENAME : \\<network location>\My Documents\Lorem Ipsum.txt
You can see that FILENAME contains the full network location and has not had the path stripped out.
It's not a browser issue, because looking via Fiddler, it appears IE 11 transmits the full file path (though I think this can vary based on the security zone):
Content-Disposition: form-data; name="p_files"; filename="V:\My Documents\Lorem Ipsum.txt"
vs.
Content-Disposition: form-data; name="p_files"; filename="\\<network location>\My Documents\Lorem Ipsum.txt"
and Chrome appears to transmit only the base file name:
Content-Disposition: form-data; name="p_files"; filename="Lorem Ipsum.txt"
It seems to me if Apex is going to strip out the path from the V:\ version, it should do the same for the \\network version, too. Is this a bug?
This is on Apex 5.1.2, mostly using IE 11.