The following python code works when I upload a local file to my local Zope server, but gives a "resource not found" error when uploading any local file to a Zope Server across the internet: context.manage_addFile(id, file=new_file_object, title=title, precondition="", content_type="") (If I change "file=new_file_object" to "new_file_object" there is the same problem) Does this mean that I have to process the path/filename in a different way, or is it some kind of permissions issue ? And how can I simply overcome the problem, do I need to use an external method or some other solution? Mark Spencer.
Mark Spencer writes:
The following python code works when I upload a local file to my local Zope server, but gives a "resource not found" error when uploading any local file to a Zope Server across the internet:
context.manage_addFile(id, file=new_file_object, title=title, precondition="", content_type="") (If I change "file=new_file_object" to "new_file_object" there is the same problem) Sounds unbelievable...
You looked at the HTML source of the error page? Often Zope puts valuable information (e.g. what exactly was not found) in HTML comments. It is also helpful to run Zope in debug mode ("-D" option) to analyse such behaviour. Dieter
We are using Zope 2.3.2 & python 1.5.2 on both machines. I don't have easy access to the remote machine as it is 100's of km away, so I assume I can't use debug mode on that computer. But we disabled access to some ports on our router, and may have done the same with Zope. I can upload files to that server using the Zope management interface, but can't do it using the code below (even though the same code works fine on my local Zope Server). So could the problem be that Zope uses different ports for uploading with the management interface rather than with code? Looking at the html comments section doesn't help me, unless this is of use to you: <!-- Traceback (innermost last): File C:\PROGRA~1\ZOPEWE~1\lib\python\ZPublisher\Publish.py, line 223, in publish_module File C:\PROGRA~1\ZOPEWE~1\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\PROGRA~1\ZOPEWE~1\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File C:\PROGRA~1\ZOPEWE~1\lib\python\ZPublisher\Publish.py, line 162, in publish File C:\PROGRA~1\ZOPEWE~1\lib\python\ZPublisher\BaseRequest.py, line 372, in traverse File C:\PROGRA~1\ZOPEWE~1\lib\python\ZPublisher\HTTPResponse.py, line 547, in notFoundError NotFound: (see above) --> Or might I need special permissions to upload over the web (I have manager permission), or have to write an external method? Any help is appreciated, Mark Spencer ----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Mark Spencer" <markwspencer@bigpond.com> Cc: <zope@zope.org> Sent: Thursday, April 04, 2002 7:46 AM Subject: Re: [Zope] manage_addFile won't work
Mark Spencer writes:
The following python code works when I upload a local file to my local Zope server, but gives a "resource not found" error when uploading any local file to a Zope Server across the internet:
context.manage_addFile(id, file=new_file_object, title=title, precondition="", content_type="") (If I change "file=new_file_object" to "new_file_object" there is the same problem) Sounds unbelievable...
You looked at the HTML source of the error page? Often Zope puts valuable information (e.g. what exactly was not found) in HTML comments. It is also helpful to run Zope in debug mode ("-D" option) to analyse such behaviour.
Dieter
Mark Spencer writes:
... file upload reports "notFoundError" on remote server, but works fine on local server ... ... I can upload files to that server using the Zope management interface, but can't do it using the code below (even though the same code works fine on my local Zope Server). So could the problem be that Zope uses different ports for uploading with the management interface rather than with code? Zope does not use different ports for normal HTTP conversastions of file uploads, nor are ports different for ZMI access and other HTTP requests (unless you do something special, e.g. put Apache in between for some type of requests but not the other).
Looking at the html comments section doesn't help me, unless this is of use to you: <!-- Traceback (innermost last): File C:\PROGRA~1\ZOPEWE~1\lib\python\ZPublisher\Publish.py, line 223, in It there nothing before the traceback?
I saw error pages with the precise URL that had the problems. The traceback as it is does not tell something interesting (as you expected) Dieter
participants (2)
-
Dieter Maurer -
Mark Spencer