Many empty characters in a file name when stored to the database
-
Tuesday, September 18, 2012 8:16 AM
Hi,
A user who has an ASP-solution is using our application to store, among other data, attachments. It looks like the problem only happens with docx file type; many space characters sneak somehow into the file name when attachment is stored to the database. When the user needs to download the attachment, the path is too long.
The error message from the logfile is like this:
[2012-09-17 09:51:40,933] - ERROR Could not process AttachmentDBRequest, RequestType: SelectNew, Attachment: <filename with many empty characters>, Too long path, file name, or both. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
System.IO.PathTooLongException: Too long path name, file name, or both. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.
ved System.IO.Path.SafeSetStackPointerValue(Char* buffer, Int32 index, Char value)
ved System.IO.Path.NormalizePathFast(String path, Boolean fullCheck)
ved System.IO.Path.NormalizePath(String path, Boolean fullCheck)
ved System.IO.Path.GetFullPathInternal(String path)
ved System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
ved System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options)
ved Descartes3.DataAccessLayer.ClientFileAccess.UnzipAttachmentData(KlientAar client, String zipEntryName, Byte[] atmData)
ved Descartes3.Controllers.AttachmentDBRequestConsumer.Proc(Object o)We have been on framework .NET 3.5 SP1 for almost a year. Before that, .NET 2.0 was in use. We have not had this problem before, as far as I know, and we are wondering what can cause it. It seems that only one user has this problem.
All suggestions on what could be causing this problem are highly appreciated.
All Replies
-
Wednesday, September 19, 2012 11:42 AMModerator
Hi atoxic,
Translate the error messages into English:
The error message from the log file is like this: [2012-09-17 09: 51: 40,933]-ERROR Could not process AttachmentDBRequest, RequestType, SelectNew, Attachment: < filename > characters with many empty, too long, path, file name, or both. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. -System.IO.PathTooLongException: too long path, file name, or both. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters.Are there other users have this issue? Use other user to try it.
Refer insert Word document into a database field: http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/486a5bbb-e6b4-4494-9b39-be2fd2dc5b03.Thanks,
MaggiePlease remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
- Marked As Answer by Maggie LuoMicrosoft Contingent Staff, Moderator Sunday, September 30, 2012 11:50 AM
-
Wednesday, September 19, 2012 12:45 PM
Hi Maggie,
Thanks for your reply. So far, there is only one user with this particular problem.
-
Sunday, September 23, 2012 11:25 AMModerator
Hi,
Any progress?
Thanks,
MaggiePlease remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
-
Tuesday, September 25, 2012 3:04 AMModerator
Hi atoxic,
Since only one user has this issue, maybe the user enters many spaces by mistake.
Thanks,
MaggiePlease remember to mark the replies as answers if they help and unmark them if they provide no help. This can be beneficial to other community members reading the thread.
-
Tuesday, September 25, 2012 6:46 AMNo, not yet. I've been busy.
-
Tuesday, September 25, 2012 6:47 AMMaybe, I have thought of it. It's just that it has happened for the second time and I've talked to the user.

