On Wednesday, May 24, 2017 at 9:37:17 PM UTC-7, Wabbajack wrote:
>
> Hi Massimo,
>
> Still has this issue... :(
>
> I am using 2.14.6 web2py running in windows7 with pydal 17.03 and python 
> 2.7
>
>
> I have this filename 54 characters (including '.pdf ')
>
>
>
>
> This is the field on my db.py
>
>
> After i add a record including an upload file  this is the Error
>
> Adding record including upload file
>
>
>
>
> Need help on resolving this issue since i cannot control the filename 
> length of the user will upload
> Also i check the length newfilename length and including its path hope it 
> helps
>
>
>
>
> The error is directing to this file
>
>
>
> I also tried changing my field with length value but still error upon 
> adding files with upload
>
>
> Thank you in advance,
> Jak
>
>  
If you're opening a file on the server, then the length of the absolute 
path may matter.  If your application folder is deeply nested, than that 
could be a problem.  On Windows, your choices

   - move your web2py (and application) folder nearer the root of the 
   filesystem
   - assign a drive letter to the path (shortening the total path) ... this 
   may be the old alias command, but it's been a while since I did this
   - use Window's version of links to provide a shorter path (I think this 
   became "real" in XP, but again I haven't done this in a while).

Note that you do have some control over the length of the filename:

   - you can reject names that are too long, usually done in the form
   - you can rename the file to a shorter name, and separately track the 
   original name

Note that my experience includes having the web2py folder in a path like 

c:/users/mememe/web2py_win/web2py-2.14.6/web2py

That's a fair-sized headstart on total pathlength,

but so far I haven't had any users (any of me) produce a filename that 
caused a problem.


On a linux system where actual users upload files, the longest name (as 
stored) is 235 characters, and the path is 57 characters.  The filename is 
actually generated by a non-web program that we control, and sent via 
libcurl.  The name encodes some information relevant to the client.


/dps




 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to