2014-01-17 36 views
0

我想將文件上傳到CherryPy中實現的表單。其實,從CherryPy網站上傳的默認實現。本教程是在這裏,它從一個GUI的工作原理:http://docs.cherrypy.org/stable/progguide/files/uploading.htmlCherryPy的標準文件上傳不能從cURL工作

的問題是,當我從捲曲嘗試:

curl -F "name=myFile" -F "[email protected]" -X POST http://127.0.0.1:8080/upload 

,輸出是:

<pre id="traceback">Traceback (most recent call last): 
    File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cprequest.py", line 656, in respond 
response.body = self.handler() 
    File "/usr/local/lib/python2.7/dist-packages/cherrypy/lib/encoding.py", line 188, in __call__ 
self.body = self.oldhandler(*args, **kwargs) 
    File "/usr/local/lib/python2.7/dist-packages/cherrypy/_cpdispatch.py", line 40, in __call__ 
raise sys.exc_info()[1] 
    HTTPError: (404, 'Missing parameters: myFile') 
</pre> 

任何想法是怎麼了? ?

謝謝, 丹尼爾。

回答

1

這應該這樣做:

curl -F "[email protected]" -X POST http://127.0.0.1:8080/upload 
+0

作品!謝謝! – Daniel