1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
18 """L{DragAndDropWrapper} can receive also files from client computer
19 if appropriate HTML 5 features are supported on client side. This class
20 wraps information about dragged file on server side.
21 """
22
23 - def __init__(self, name, size, mimeType):
24 self._name = name
25 self._size = size
26 self._type = mimeType
27 self._streamVariable = None
28
29
32
33
36
37
40
41
43 """Sets the L{StreamVariable} that into which the file contents
44 will be written. Usage of StreamVariable is similar to L{Upload}
45 component.
46
47 If the L{StreamVariable} is not set in the L{DropHandler}
48 the file contents will not be sent to server.
49
50 I{Note!} receiving file contents is experimental feature
51 depending on HTML 5 API's. It is supported only by modern web browsers
52 like Firefox 3.6 and above and recent webkit based browsers (Safari 5,
53 Chrome 6) at this time.
54
55 @param streamVariable:
56 the callback that returns stream where the implementation
57 writes the file contents as it arrives.
58 """
59 self._streamVariable = streamVariable
60
61
63 return self._streamVariable
64