Issue with double spaces in filenames

I believe that I may have found a bug when it comes to double spaces in
fileNames. I’m on a windows server using Lucee 4.5.1.024. When i use
cffile to upload a document that contains a double space in the filename
the file is written to the server with the double space in tact. However
file.serverfile appears to have trimmed the filename and outputs a single
space which is resulting in a file not found error. I wrote the following
test code and confirmed the same issue in cfDirectory:

My filename is: ‘test file.pdf’

Which outputs:
Query
Execution Time: 0.436 ms
Record Count: 2
Cached: No
Lazy: No
namesizetypedateLastModifiedattributesmodedirectory1index.cfm117File{ts
‘2015-11-05 21:59:28’}C:\inetpub\wwwroot\application\secure\test\doubleSpace
2test file.pdf83699File{ts ‘2015-11-05 21:57:30’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace

Note the double space in my fileName and the single space in getFiles.name
Any suggestions to work around this? I have also confirmed the same issue
exists in the latest version of Railo.

Thanks!
Jace

Ok, but how is Lucee finding “test file.pdf” to output it in that dump?
Where’s the file not found error? To me, seems to have found
the file.

How do you know there is a single space in the getFiles.name result?
(Perhaps you could test the length of the file name using len() and see if
it is shorter than expected.)

Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamediaOn Thu, Nov 5, 2015 at 11:11 PM, Jace Coleman <@Jace_Coleman> wrote:

I believe that I may have found a bug when it comes to double spaces in
fileNames. I’m on a windows server using Lucee 4.5.1.024. When i use
cffile to upload a document that contains a double space in the filename
the file is written to the server with the double space in tact. However
file.serverfile appears to have trimmed the filename and outputs a single
space which is resulting in a file not found error. I wrote the following
test code and confirmed the same issue in cfDirectory:

My filename is: ‘test file.pdf’

Which outputs:
Query
Execution Time: 0.436 ms
Record Count: 2
Cached: No
Lazy: No
namesizetypedateLastModifiedattributesmodedirectory1index.cfm117File{ts
‘2015-11-05 21:59:28’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace2test file.pdf83699
File{ts ‘2015-11-05 21:57:30’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace

Note the double space in my fileName and the single space in getFiles.name
Any suggestions to work around this? I have also confirmed the same issue
exists in the latest version of Railo.

Thanks!
Jace


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/7051eb77-6f73-45a3-9cd4-38ad3be4dfa3%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7051eb77-6f73-45a3-9cd4-38ad3be4dfa3%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

Unless you can demonstrate otherwise, I’m under the impression that the
file name is correct, but is simply being rendered in the browser as having
only one space. See the following:

Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamediaOn Fri, Nov 6, 2015 at 4:27 PM, Jace Coleman <@Jace_Coleman> wrote:

Len() outputs 14 just as one would expect with the double space, even
though the dump only shows 13 characters and one space. I need to be able
to retrieve an accurate file name via cffile in order to provide a link to
the file that was uploaded by a user.

On Thursday, November 5, 2015 at 4:20:12 PM UTC-7, Nando Breiter wrote:

Ok, but how is Lucee finding “test file.pdf” to output it in that dump?
Where’s the file not found error? To me, seems to have found
the file.

How do you know there is a single space in the getFiles.name result?
(Perhaps you could test the length of the file name using len() and see if
it is shorter than expected.)

Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

On Thu, Nov 5, 2015 at 11:11 PM, Jace Coleman jace.c...@gmail.com wrote:

I believe that I may have found a bug when it comes to double spaces in
fileNames. I’m on a windows server using Lucee 4.5.1.024. When i use
cffile to upload a document that contains a double space in the filename
the file is written to the server with the double space in tact. However
file.serverfile appears to have trimmed the filename and outputs a single
space which is resulting in a file not found error. I wrote the following
test code and confirmed the same issue in cfDirectory:

My filename is: ‘test file.pdf’

Which outputs:
Query
Execution Time: 0.436 ms
Record Count: 2
Cached: No
Lazy: No
namesizetypedateLastModifiedattributesmodedirectory1index.cfm117File{ts
‘2015-11-05 21:59:28’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace2test file.pdf
83699File{ts ‘2015-11-05 21:57:30’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace

Note the double space in my fileName and the single space in
getFiles.name
Any suggestions to work around this? I have also confirmed the same
issue exists in the latest version of Railo.

Thanks!
Jace


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google
Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/7051eb77-6f73-45a3-9cd4-38ad3be4dfa3%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7051eb77-6f73-45a3-9cd4-38ad3be4dfa3%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html


You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/8178f90a-d180-4832-90ed-88d24ed71b69%40googlegroups.com
https://groups.google.com/d/msgid/lucee/8178f90a-d180-4832-90ed-88d24ed71b69%40googlegroups.com?utm_medium=email&utm_source=footer
.

For more options, visit https://groups.google.com/d/optout.

Len() outputs 14 just as one would expect with the double space, even
though the dump only shows 13 characters and one space. I need to be able
to retrieve an accurate file name via cffile in order to provide a link to
the file that was uploaded by a user.On Thursday, November 5, 2015 at 4:20:12 PM UTC-7, Nando Breiter wrote:

Ok, but how is Lucee finding “test file.pdf” to output it in that dump?
Where’s the file not found error? To me, seems to have found
the file.

How do you know there is a single space in the getFiles.name result?
(Perhaps you could test the length of the file name using len() and see if
it is shorter than expected.)

Aria Media Sagl
Via Rompada 40
6987 Caslano
Switzerland

+41 (0)91 600 9601
+41 (0)76 303 4477 cell
skype: ariamedia

On Thu, Nov 5, 2015 at 11:11 PM, Jace Coleman <jace.c...@gmail.com <javascript:>> wrote:

I believe that I may have found a bug when it comes to double spaces in
fileNames. I’m on a windows server using Lucee 4.5.1.024. When i use
cffile to upload a document that contains a double space in the filename
the file is written to the server with the double space in tact. However
file.serverfile appears to have trimmed the filename and outputs a single
space which is resulting in a file not found error. I wrote the following
test code and confirmed the same issue in cfDirectory:

My filename is: ‘test file.pdf’

Which outputs:
Query
Execution Time: 0.436 ms
Record Count: 2
Cached: No
Lazy: No
namesizetypedateLastModifiedattributesmodedirectory1index.cfm117File{ts
‘2015-11-05 21:59:28’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace2test file.pdf83699
File{ts ‘2015-11-05 21:57:30’}
C:\inetpub\wwwroot\application\secure\test\doubleSpace

Note the double space in my fileName and the single space in getFiles.name
Any suggestions to work around this? I have also confirmed the same
issue exists in the latest version of Railo.

Thanks!
Jace


Love Lucee? Become a supporter and be part of the Lucee project today! -
http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+un...@googlegroups.com <javascript:>.
To post to this group, send email to lu...@googlegroups.com <javascript:>
.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/7051eb77-6f73-45a3-9cd4-38ad3be4dfa3%40googlegroups.com
https://groups.google.com/d/msgid/lucee/7051eb77-6f73-45a3-9cd4-38ad3be4dfa3%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

We ran into the same issue. Lucee preserves multiple spaces in the filename
when saving the actual file but in the filename return variables it
combines multiple spaces into one. I’m going to submit a bug in their issue
tracker if I don’t already see one.

Nando,

  • you can view source on his included dump table html to see that there
    is truly once space and not html combining them.
  • cfdirectory can “find” it because it isn’t looking for a particular
    file, it’s looking for a folder and looping through all files in the folder
    and returning the results … incorrectly for the name attribute since it’s
    combining spaces
  • his len() example is obviously before html has any part in this

I was actually able to resolve this and at least in my case Nando was
correct. If I recall correctly my problem was that I was uploading the
file asynchronsly and then using JS to update a form field containing the
file name then submitting the form.On Monday, December 21, 2015 at 3:02:52 PM UTC-7, Greg Wacker wrote:

We ran into the same issue. Lucee preserves multiple spaces in the
filename when saving the actual file but in the filename return variables
it combines multiple spaces into one. I’m going to submit a bug in their
issue tracker if I don’t already see one.

Nando,

  • you can view source on his included dump table html to see that
    there is truly once space and not html combining them.
  • cfdirectory can “find” it because it isn’t looking for a particular
    file, it’s looking for a folder and looping through all files in the folder
    and returning the results … incorrectly for the name attribute since it’s
    combining spaces
  • his len() example is obviously before html has any part in this

And you are not using the “suppress whitespace” option in the admin?

Kind regards,

Paul Klinkenberg------------

Op 21 dec. 2015 om 23:32 heeft Jace Coleman <@Jace_Coleman> het volgende geschreven:

I was actually able to resolve this and at least in my case Nando was correct. If I recall correctly my problem was that I was uploading the file asynchronsly and then using JS to update a form field containing the file name then submitting the form.

On Monday, December 21, 2015 at 3:02:52 PM UTC-7, Greg Wacker wrote:
We ran into the same issue. Lucee preserves multiple spaces in the filename when saving the actual file but in the filename return variables it combines multiple spaces into one. I’m going to submit a bug in their issue tracker if I don’t already see one.

Nando,
you can view source on his included dump table html to see that there is truly once space and not html combining them.
cfdirectory can “find” it because it isn’t looking for a particular file, it’s looking for a folder and looping through all files in the folder and returning the results … incorrectly for the name attribute since it’s combining spaces
his len() example is obviously before html has any part in this


Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/c6153330-4843-4c52-99a2-933525538934%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.