Subversion Repositories SmartDukaan

Rev

Rev 16815 | Rev 16818 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 16815 Rev 16817
Line 164... Line 164...
164
            
164
            
165
            
165
            
166
    def on_post(self, request, resp):
166
    def on_post(self, request, resp):
167
        try:
167
        try:
168
            boundary = request.content_type.split(";")[1].strip().split("=")[1]
168
            boundary = request.content_type.split(";")[1].strip().split("=")[1]
-
 
169
            print boundary
169
            chunks = []
170
            chunks = []
170
            filepath = "/tmp/rejectfile"
171
            filepath = "/tmp/rejectfile"
171
            with open(filepath, 'wb') as image_file:
172
            with open(filepath, 'wb') as image_file:
172
                while True:
173
                while True:
173
                    chunk = request.stream.read(4096)
174
                    chunk = request.stream.read(4096)
Line 186... Line 187...
186
                print "Final chunk"
187
                print "Final chunk"
187
                print chunk
188
                print chunk
188
 
189
 
189
            #rejectCount = process_rejects(filepath) #this function is not yet implemented
190
            #rejectCount = process_rejects(filepath) #this function is not yet implemented
190
            rejectCount = 1
191
            rejectCount = 1
-
 
192
            resp.content_type = 'text/html'
191
            resp.body = """
193
            resp.body = """
192
                <html><head><title>Upload Rejects</title></head><body>
194
                <html><head><title>Upload Rejects</title></head><body>
193
            <h1>Reject Successful</h1>
195
            <h1>Reject Successful</h1>
194
            <h2> %d orders rejected</h2>
196
            <h2> %d orders rejected</h2>
195
   
197