Re: [web2py] Error uploading 60 character named .pptx file

2013-11-15 Thread Rahul
Hi All,
 Thanks! Limedrop, your suggestion resolves the issue.  Thanks! Loic, 
Niphlod, Ricardo and All for your valuable suggestions and responses. Thanks

Web2py has #1 community. 

Cheers! Rahul



On Friday, November 15, 2013 2:49:22 AM UTC+5:30, Limedrop wrote:
>
> Actually, the web2py setting you're looking for is 'length'.  Here's an 
> example:
>
>
> db.define_table('document',
> Field('document_filename', writable=False, compute = lambda row: 
> request.post_vars.document.filename),
> Field('document','upload',autodelete=True,
>   requires=IS_LENGTH(minsize=10, maxsize=9048576, 
> error_message='Please select a file.')),
> )
>
> # Windows has a maximum length of 260 characters for a file's combined 
> path and name
> import platform
> if platform.system() == 'Windows':
> db.document.document.length = 100
>
>
>
>
> On Friday, November 15, 2013 4:01:56 AM UTC+13, Loïc wrote:
>>
>> I had a similar issue some time ago, but Windows was my testing machine, 
>> not the production server OS. So it was not very annoying...
>> If you want to host on Windows, you may have to store the original 
>> filename in the database, and change it on the disk : 
>>
>> http://web2py.com/books/default/chapter/29/07?search=uploads#Storing-the-original-filename
>>
>>
>>
>> Le jeudi 14 novembre 2013 11:03:05 UTC+1, Rahul a écrit :
>>>
>>> Okay - 
>>>  So in my case the file name actually passed to DB is as highlighted 
>>> below - this is 229 characters long (still smaller than 260 limit). Can the 
>>> upload field handle such long file names ? Do you think that could be the 
>>> problem? How do we specify file name character limit in db.py when defining 
>>> files I know we can specify the size but how names of files ? Any idea? 
>>>
>>> in db.py I have  - 
>>>  Field('attach_file','upload'))
>>>
>>> I am not using blob to store files- instead files are stored on server 
>>> at a specified path. 
>>>
>>>
>>> issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx
>>> Regards, Rahul
>>>
>>> On Thursday, November 14, 2013 2:11:13 PM UTC+5:30, Niphlod wrote:



 On Thursday, November 14, 2013 6:21:26 AM UTC+1, Rahul wrote:
>
> Hi Ricardo, 
>  Thanks for the response, but I don't understand why it should 
> be a windows limit. I have many files with much larger names in windows, 
> never had such a problem. Besides this only occurs when we are uploading 
> it 
> in web2py. Could SQLite database be a constraint ? I am using sqlite for 
> this app.  What might cause this, for now I have reduced the file name 
> and 
> it gets uploaded just fine. 
>
> Sincerely, Rahul D.
>
>>
>>  
 There's no way  you can have a path with more than 260 characters in 
 windows. Any database has no issues on handling long paths, only the 
 underlying filesystem. If you choose to store files in your uploads 
 folder, 
 and you are on windows, you need to limit the length of the filenames 
 users 
 try to upload. Alternatively, you can store files in the database in a 
 blob 
 field.

>>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-14 Thread Limedrop
Actually, the web2py setting you're looking for is 'length'.  Here's an 
example:


db.define_table('document',
Field('document_filename', writable=False, compute = lambda row: 
request.post_vars.document.filename),
Field('document','upload',autodelete=True,
  requires=IS_LENGTH(minsize=10, maxsize=9048576, 
error_message='Please select a file.')),
)

# Windows has a maximum length of 260 characters for a file's combined path 
and name
import platform
if platform.system() == 'Windows':
db.document.document.length = 100




On Friday, November 15, 2013 4:01:56 AM UTC+13, Loïc wrote:
>
> I had a similar issue some time ago, but Windows was my testing machine, 
> not the production server OS. So it was not very annoying...
> If you want to host on Windows, you may have to store the original 
> filename in the database, and change it on the disk : 
>
> http://web2py.com/books/default/chapter/29/07?search=uploads#Storing-the-original-filename
>
>
>
> Le jeudi 14 novembre 2013 11:03:05 UTC+1, Rahul a écrit :
>>
>> Okay - 
>>  So in my case the file name actually passed to DB is as highlighted 
>> below - this is 229 characters long (still smaller than 260 limit). Can the 
>> upload field handle such long file names ? Do you think that could be the 
>> problem? How do we specify file name character limit in db.py when defining 
>> files I know we can specify the size but how names of files ? Any idea? 
>>
>> in db.py I have  - 
>>  Field('attach_file','upload'))
>>
>> I am not using blob to store files- instead files are stored on server at 
>> a specified path. 
>>
>>
>> issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx
>> Regards, Rahul
>>
>> On Thursday, November 14, 2013 2:11:13 PM UTC+5:30, Niphlod wrote:
>>>
>>>
>>>
>>> On Thursday, November 14, 2013 6:21:26 AM UTC+1, Rahul wrote:

 Hi Ricardo, 
  Thanks for the response, but I don't understand why it should 
 be a windows limit. I have many files with much larger names in windows, 
 never had such a problem. Besides this only occurs when we are uploading 
 it 
 in web2py. Could SQLite database be a constraint ? I am using sqlite for 
 this app.  What might cause this, for now I have reduced the file name and 
 it gets uploaded just fine. 

 Sincerely, Rahul D.

>
>  
>>> There's no way  you can have a path with more than 260 characters in 
>>> windows. Any database has no issues on handling long paths, only the 
>>> underlying filesystem. If you choose to store files in your uploads folder, 
>>> and you are on windows, you need to limit the length of the filenames users 
>>> try to upload. Alternatively, you can store files in the database in a blob 
>>> field.
>>>
>>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-14 Thread Loïc
I had a similar issue some time ago, but Windows was my testing machine, 
not the production server OS. So it was not very annoying...
If you want to host on Windows, you may have to store the original filename 
in the database, and change it on the disk : 
http://web2py.com/books/default/chapter/29/07?search=uploads#Storing-the-original-filename



Le jeudi 14 novembre 2013 11:03:05 UTC+1, Rahul a écrit :
>
> Okay - 
>  So in my case the file name actually passed to DB is as highlighted below 
> - this is 229 characters long (still smaller than 260 limit). Can the 
> upload field handle such long file names ? Do you think that could be the 
> problem? How do we specify file name character limit in db.py when defining 
> files I know we can specify the size but how names of files ? Any idea? 
>
> in db.py I have  - 
>  Field('attach_file','upload'))
>
> I am not using blob to store files- instead files are stored on server at 
> a specified path. 
>
>
> issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx
> Regards, Rahul
>
> On Thursday, November 14, 2013 2:11:13 PM UTC+5:30, Niphlod wrote:
>>
>>
>>
>> On Thursday, November 14, 2013 6:21:26 AM UTC+1, Rahul wrote:
>>>
>>> Hi Ricardo, 
>>>  Thanks for the response, but I don't understand why it should 
>>> be a windows limit. I have many files with much larger names in windows, 
>>> never had such a problem. Besides this only occurs when we are uploading it 
>>> in web2py. Could SQLite database be a constraint ? I am using sqlite for 
>>> this app.  What might cause this, for now I have reduced the file name and 
>>> it gets uploaded just fine. 
>>>
>>> Sincerely, Rahul D.
>>>

  
>> There's no way  you can have a path with more than 260 characters in 
>> windows. Any database has no issues on handling long paths, only the 
>> underlying filesystem. If you choose to store files in your uploads folder, 
>> and you are on windows, you need to limit the length of the filenames users 
>> try to upload. Alternatively, you can store files in the database in a blob 
>> field.
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-14 Thread Niphlod
path is everything going from *d:\* to *.pptx*, not just the filename

On Thursday, November 14, 2013 11:03:05 AM UTC+1, Rahul wrote:
>
> Okay - 
>  So in my case the file name actually passed to DB is as highlighted below 
> - this is 229 characters long (still smaller than 260 limit). Can the 
> upload field handle such long file names ? Do you think that could be the 
> problem? How do we specify file name character limit in db.py when defining 
> files I know we can specify the size but how names of files ? Any idea? 
>
> in db.py I have  - 
>  Field('attach_file','upload'))
>
> I am not using blob to store files- instead files are stored on server at 
> a specified path. 
>
>
> issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx
> Regards, Rahul
>
> On Thursday, November 14, 2013 2:11:13 PM UTC+5:30, Niphlod wrote:
>>
>>
>>
>> On Thursday, November 14, 2013 6:21:26 AM UTC+1, Rahul wrote:
>>>
>>> Hi Ricardo, 
>>>  Thanks for the response, but I don't understand why it should 
>>> be a windows limit. I have many files with much larger names in windows, 
>>> never had such a problem. Besides this only occurs when we are uploading it 
>>> in web2py. Could SQLite database be a constraint ? I am using sqlite for 
>>> this app.  What might cause this, for now I have reduced the file name and 
>>> it gets uploaded just fine. 
>>>
>>> Sincerely, Rahul D.
>>>

  
>> There's no way  you can have a path with more than 260 characters in 
>> windows. Any database has no issues on handling long paths, only the 
>> underlying filesystem. If you choose to store files in your uploads folder, 
>> and you are on windows, you need to limit the length of the filenames users 
>> try to upload. Alternatively, you can store files in the database in a blob 
>> field.
>>
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-14 Thread Rahul
Okay - 
 So in my case the file name actually passed to DB is as highlighted below 
- this is 229 characters long (still smaller than 260 limit). Can the 
upload field handle such long file names ? Do you think that could be the 
problem? How do we specify file name character limit in db.py when defining 
files I know we can specify the size but how names of files ? Any idea? 

in db.py I have  - 
 Field('attach_file','upload'))

I am not using blob to store files- instead files are stored on server at a 
specified path. 

issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx
Regards, Rahul

On Thursday, November 14, 2013 2:11:13 PM UTC+5:30, Niphlod wrote:
>
>
>
> On Thursday, November 14, 2013 6:21:26 AM UTC+1, Rahul wrote:
>>
>> Hi Ricardo, 
>>  Thanks for the response, but I don't understand why it should be 
>> a windows limit. I have many files with much larger names in windows, never 
>> had such a problem. Besides this only occurs when we are uploading it in 
>> web2py. Could SQLite database be a constraint ? I am using sqlite for this 
>> app.  What might cause this, for now I have reduced the file name and it 
>> gets uploaded just fine. 
>>
>> Sincerely, Rahul D.
>>
>>>
>>>  
> There's no way  you can have a path with more than 260 characters in 
> windows. Any database has no issues on handling long paths, only the 
> underlying filesystem. If you choose to store files in your uploads folder, 
> and you are on windows, you need to limit the length of the filenames users 
> try to upload. Alternatively, you can store files in the database in a blob 
> field.
>

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-14 Thread Niphlod


On Thursday, November 14, 2013 6:21:26 AM UTC+1, Rahul wrote:
>
> Hi Ricardo, 
>  Thanks for the response, but I don't understand why it should be 
> a windows limit. I have many files with much larger names in windows, never 
> had such a problem. Besides this only occurs when we are uploading it in 
> web2py. Could SQLite database be a constraint ? I am using sqlite for this 
> app.  What might cause this, for now I have reduced the file name and it 
> gets uploaded just fine. 
>
> Sincerely, Rahul D.
>
>>
>>  
There's no way  you can have a path with more than 260 characters in 
windows. Any database has no issues on handling long paths, only the 
underlying filesystem. If you choose to store files in your uploads folder, 
and you are on windows, you need to limit the length of the filenames users 
try to upload. Alternatively, you can store files in the database in a blob 
field.

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-13 Thread Rahul
Hi Ricardo, 
 Thanks for the response, but I don't understand why it should be a 
windows limit. I have many files with much larger names in windows, never 
had such a problem. Besides this only occurs when we are uploading it in 
web2py. Could SQLite database be a constraint ? I am using sqlite for this 
app.  What might cause this, for now I have reduced the file name and it 
gets uploaded just fine. 

Sincerely, Rahul D.


On Wednesday, November 13, 2013 4:57:41 PM UTC+5:30, Ricardo Pedroso wrote:
>
>
>
>
> On Wed, Nov 13, 2013 at 10:00 AM, Rahul 
> > wrote:
>
>> Hi All,
>>   I get an error like below when I upload a file (.pptx [could be 
>> with other extensions too not tested]) in latest web2py - downloaded from 
>> trunk yesterday as below. I am on Win7 and IE9 .The file name looks 
>> insanely huge as highlighted below. I am able to upload pptx files prior to 
>> this file albeit short names. This file has approximately sixty characters 
>> like [Toney Catters expose Spouscold data to Int Locount list view].pptx. 
>> Is there a limit on file name specification when attaching files in web2py 
>> (note - I haven't specified any in the app)?
>>
>> *Error Description: *
>>  [Errno 2] No such file or directory: 
>> 'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
>> \\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
>>  
>>
>
> You may be hitting a windows limit:
> http://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath
>
>
>  

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [web2py] Error uploading 60 character named .pptx file

2013-11-13 Thread Ricardo Pedroso
On Wed, Nov 13, 2013 at 10:00 AM, Rahul  wrote:

> Hi All,
>   I get an error like below when I upload a file (.pptx [could be with
> other extensions too not tested]) in latest web2py - downloaded from trunk
> yesterday as below. I am on Win7 and IE9 .The file name looks insanely huge
> as highlighted below. I am able to upload pptx files prior to this file
> albeit short names. This file has approximately sixty characters like
> [Toney Catters expose Spouscold data to Int Locount list view].pptx. Is
> there a limit on file name specification when attaching files in web2py
> (note - I haven't specified any in the app)?
>
> *Error Description: *
>  [Errno 2] No such file or directory:
> 'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
> \\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
>

You may be hitting a windows limit:
http://msdn.microsoft.com/en-us/library/aa365247.aspx#maxpath

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


[web2py] Error uploading 60 character named .pptx file

2013-11-13 Thread Rahul
Hi All,
  I get an error like below when I upload a file (.pptx [could be with 
other extensions too not tested]) in latest web2py - downloaded from trunk 
yesterday as below. I am on Win7 and IE9 .The file name looks insanely huge 
as highlighted below. I am able to upload pptx files prior to this file 
albeit short names. This file has approximately sixty characters like 
[Toney Catters expose Spouscold data to Int Locount list view].pptx. Is 
there a limit on file name specification when attaching files in web2py 
(note - I haven't specified any in the app)?

*Error Description: *
 [Errno 2] No such file or directory: 
'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads
\\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx'
Versionweb2py™Version 2.7.4-stable+timestamp.2013.10.27.19.58.30PythonPython 
2.7.5: C:\Python27\python.exe (prefix: C:\Python27)Traceback

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.

Traceback (most recent call last):
  File "D:\Web2py\web2py\gluon\restricted.py", line 217, in restricted
exec ccode in environment
  File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py" 
, line 7774, in 
  File "D:\Web2py\web2py\gluon\globals.py", line 372, in 
self._caller = lambda f: f()
  File "D:/Web2py/web2py/applications/BBOnline/controllers/default.py" 
, line 2699, in 
update_issues
if form.accepts(request.vars,session):
  File "D:\Web2py\web2py\gluon\sqlhtml.py", line 1505, in accepts
field.uploadfolder)
  File "D:\Web2py\web2py\gluon\dal.py", line 9681, in store
dest_file = open(pathfilename, 'wb')
IOError: [Errno 2] No such file or directory: 
'D:\\Web2py\\web2py\\applications\\BBOnline\\databases\\..\\uploads\\issues.attach_file.8ddd3149b14cb8e9.4d6f6e6579204d617474657273206578706f7365205072696d6172792041647669736f722066726f6d20436f6e7461637420746f20496e76204163636f756e74207669657720616e642064796e616d6963207265706f7274732e70707478.pptx

Sincerley, Rahul D.

-- 
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 web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.