DMXzone DropZone Add-on Support Product Page

In progress

Error message when I drop a file

Reported 24 Apr 2016 17:59:57
2
have this problem
24 Apr 2016 17:59:57 EDUARDO PEREZ posted:
Hi, I am having a problem using this extension. When I drop an image, I receive an error message as you can see below. I think the problem is with the path where I would like to upload the files. Perhaps the problem is with the extension HTML5 File Upload. I own this extension too and I can´t get it works. In HTML5 File Upload nothing happens when I click on the submit button of my form. I don´t get any descriptive error and I have activated the debug mode on DMXZone Server Connect.

Error Message:
{"type":"ExecuteError","fileName":"lib/core/multipart.asp","errorNumber":-2147467259,"message":"006~ASP 0171~Ruta de acceso ausente~El parámetro Path debe especificarse para el método MapPath.","stack":[],"data":"function(exports, module, require) { \r\n\r\n\tvar utf8 = require('lib/crypto/utf8');\r\n\r\n\tvar fields = [];\r\n\tvar files = [];\r\n\r\n\t(function() {/* STACK({\"fileName\":\"lib/core/multipart.asp\", \"lineNumber\":8, \"method\": \"undefined\"}) */\r\n\r\n\t\t// do we have data?\r\n\t\tif (Request.TotalBytes === 0) { return; }\r\n\r\n\t\t// boundary should be given in the content-type header\r\n\t\tvar m = String(Request.ServerVariables(\"Http_Content_Type\").match(/boundary=(?:\"([^\"]+)\"|([^;]+))/i);\r\n\t\tif (!m) { return; }\r\n\r\n\t\tvar boundary = '--' + (m[1] || m[2]);\r\n\t\tvar stream = readRequest();\r\n\t\tvar body = streamToString(stream);\r\n\r\n\t\tvar p = 0, p2, headers, headerData;\r\n\r\n\t\twhile (true) {\r\n\t\t\tp += boundary.length;\r\n\r\n\t\t\t// offset outside of the request body\r\n\t\t\tif (p > body.length) { break; }\r\n\r\n\t\t\t// when the boundary is followed by -- it is the end of the request\r\n\t\t\tif (body.substr(p, 2) === '--') { break; }\r\n\r\n\t\t\t// skip the \\r\\n\r\n\t\t\tp += 2;\r\n\r\n\t\t\t// look for the end of the header block\r\n\t\t\tp2 = body.indexOf('\\r\\n\\r\\n', p);\r\n\r\n\t\t\t// lets extract the headers\r\n\t\t\theaders = {};\r\n\t\t\theaderData = body.substring(p, p2).split('\\r\\n');\r\n\t\t\tfor (var header, hp, i = 0; i < headerData.length; i++) {\r\n\t\t\t\theader = utf8.decode(headerData[i]);\r\n\t\t\t\thp = header.indexOf(':');\r\n\r\n\t\t\t\tif (hp > 0) {\r\n\t\t\t\t\theaders[header.substr(0, hp).trim().toLowerCase()] = header.substr(hp + 1).trim();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// find the next boundary position\r\n\t\t\tp = body.indexOf(boundary, p);\r\n\r\n\t\t\tif (headers['content-disposition']) {\r\n\t\t\t\tif ((m = headers['content-disposition'].match(/\\bname=\"([^\"]+)\"/i))) {\r\n\t\t\t\t\tvar startPos = p2 + 4, // start is the position of the end of the headers plus 4 for the \\r\\n\\r\\n\r\n\t\t\t\t\t\tendPos = p - 2, // end is the next boundary position minus 2 for the \\r\\n\r\n\t\t\t\t\t\tname = m[1], // name\r\n\t\t\t\t\t\tfilename = parseFilename(headers['content-disposition']); // filename\r\n\r\n\t\t\t\t\tif (filename) {\r\n\t\t\t\t\t\tvar tmp = getGlobal('TEMP_FOLDER'),\r\n\t\t\t\t\t\t\ttmpfolder = tmp.indexOf(':\\\\') == -1 ? Server.MapPath(tmp) : tmp,\r\n\t\t\t\t\t\t\ttmpfile = FileSystem.BuildPath(tmpfolder, FileSystem.GetTempName()),\r\n\t\t\t\t\t\t\tsize = endPos - startPos,\r\n\t\t\t\t\t\t\terror = 0;\r\n\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tsaveFileFromStream(tmpfile, stream, startPos, size);\r\n\t\t\t\t\t\t} catch(e) {\r\n\t\t\t\t\t\t\terror = 7;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t//fields.push({ name: name, value: filename });\r\n\t\t\t\t\t\tfields.push({\r\n\t\t\t\t\t\t\tname: name,\r\n\t\t\t\t\t\t\tvalue: {\r\n\t\t\t\t\t\t\t\tisFile: true,\r\n\t\t\t\t\t\t\t\terror: error,\r\n\t\t\t\t\t\t\t\tname: filename,\r\n\t\t\t\t\t\t\t\ttype: headers['content-type'],\r\n\t\t\t\t\t\t\t\ttmp_name: tmpfile,\r\n\t\t\t\t\t\t\t\tsize: size\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\tfiles.push({\r\n\t\t\t\t\t\t\tname: filename,\r\n\t\t\t\t\t\t\ttype: headers['content-type'],\r\n\t\t\t\t\t\t\ttmp_name: tmpfile,\r\n\t\t\t\t\t\t\tsize: size\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tfields.push({ name: name, value: body.substring(startPos, endPos) });\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tstream.Close();\r\n\r\n\t})();\r\n\r\n\tfunction parseFilename(header) {/* STACK({\"fileName\":\"lib/core/multipart.asp\", \"lineNumber\":103, \"method\": \"parseFilename\"}) */\r\n\t\tvar m = header.match(/\\bfilename=\"([^\"]+)\"($|; )/i);\r\n\r\n\t\tif (!m) {\r\n\t\t\tm = header.match(/\\bfilename*=utf-8\\'\\'(.*?)($|; )/i);\r\n\r\n\t\t\tif (m) {\r\n\t\t\t\tm[1] = decodeURI(m[1]);\r\n\t\t\t} else {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tvar filename = m[1].substr(m[1].lastIndexOf('\\\\') + 1);\r\n\t\tfilename = filename.replace(/%22/g, '\"');\r\n\t\tfilename = filename.replace(/&#([\\d]{4});/g, function(m, code) {/* STACK({\"fileName\":\"lib/core/multipart.asp\", \"lineNumber\":118, \"method\": \"undefined\"}) */\r\n\t\t\treturn String.fromCharCode(code);\r\n\t\t});\r\n\t\treturn filename;\r\n\t}\r\n\r\n\t// read the binary request and give back as stream object\r\n\tfunction readRequest() {/* STACK({\"fileName\":\"lib/core/multipart.asp\", \"lineNumber\":125, \"method\": \"readRequest\"}) */\r\n\t\tvar Stream = Server.CreateObject('ADODB.Stream');\r\n\t\tStream.Mode = 3; // read/write\r\n\t\tStream.Type = 1; // binary\r\n\t\tStream.Open();\r\n\t\ttry {\r\n\t\t\tStream.Write(Request.BinaryRead(Request.TotalBytes));\r\n\t\t} catch(e) {\r\n\t\t\te.message = 'maximum request length exceeded';\r\n\t\t\terr(e);\r\n\t\t}\r\n\t\tStream.Position = 0;\r\n\t\treturn Stream;\r\n\t}\r\n\r\n\t// convert a binary stream to a string\r\n\tfunction streamToString(BinaryStream) {/* STACK({\"fileName\":\"lib/core/multipart.asp\", \"lineNumber\":141, \"method\": \"streamToString\"}) */\r\n\t\tvar Stream = Server.CreateObject('ADODB.Stream');\r\n\t\tStream.Mode = 3; // read/write\r\n\t\tStream.Type = 1; // binary\r\n\t\tStream.Open();\r\n\r\n\t\t// set the binary stream position to 0\r\n\t\tBinaryStream.Position = 0;\r\n\t\t// copy the binary stream to local stream for conversion\r\n\t\tStream.Write(BinaryStream.Read());\r\n\r\n\t\t// reset position\r\n\t\tStream.Position = 0;\r\n\t\tStream.Type = 2; // text\r\n\t\tStream.Charset = 'ISO-8859-1'; // charcodes <-> bytecode\r\n\r\n\t\t// return the text stream as string\r\n\t\tvar str = Stream.ReadText();\r\n\r\n\t\tStream.Close();\r\n\r\n\t\treturn str;\r\n\t}\r\n\r\n\tfunction saveFileFromStream(filename, Stream, startPos, size) {/* STACK({\"fileName\":\"lib/core/multipart.asp\", \"lineNumber\":165, \"method\": \"saveFileFromStream\"}) */\r\n\t\t// set the source stream to the start position of the file\r\n\t\tStream.Position = startPos;\r\n\r\n\t\tvar FileStream = Server.CreateObject('ADODB.Stream');\r\n\t\tFileStream.Mode = 3; // read/write\r\n\t\tFileStream.Type = 1; // binary\r\n\t\tFileStream.Open();\r\n\t\tFileStream.Write(Stream.Read(size)); // copy the data\r\n\t\tFileStream.SaveToFile(filename); // save the file\r\n\t\tFileStream.Close();\r\n\t}\r\n\r\n\texports.fields = fields;\r\n\texports.files = files;\r\n\r\n\r\n}"}

Replies

Replied 25 Apr 2016 08:39:30
25 Apr 2016 08:39:30 Teodor Kuduschiev replied:
Hello Eduardo,
It appears there is some issue with an invalid temp folder defined. Make sure to define a temp folder in the server connect settings. Make sure the temp folder has write/modify permissions.
Replied 28 Apr 2016 18:35:07
28 Apr 2016 18:35:07 EDUARDO PEREZ replied:
Thanks. I have set up a temp folder with read/write permissions. Now I receive this error message when I try to upoad an image to my upload folder:

Error messge:


{"type":"Error","fileName":"modules/upload.asp","lineNumber":26,"message":"'this.app.request' es nulo o no es un objeto","stack":[{"fileName":"lib/core/response.asp","lineNumber":184,"method":"error","args":[{"type":"TypeError","fileName":"modules/upload.asp","lineNumber":26,"errorNumber":-2146823281,"message":"'this.app.request' es nulo o no es un objeto","stack":[{"fileName":"modules/upload.asp","lineNumber":26,"method":"upload","args":[{"fields":[{"isFile":true,"error":0,"name":"Desert.jpg","type":"image/jpeg","tmp_name":"D:\\WEBS\\SCP\\almacen\\temp\\radE828E.tmp","size":845941}],"path":"/upload","throwErrors":true,"overwrite":false,"createPath":true},"upload1"]},{"fileName":"lib/app.asp","lineNumber":114,"method":"_exec","args":[{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}]},{"fileName":"lib/app.asp","lineNumber":88,"method":"exec","args":[{"steps":{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}}]},{"fileName":"lib/app.asp","lineNumber":45,"method":"define","args":[{"meta":{"options":{"linkedFile":"/default.asp","linkedForm":"dropzone1"},"$_POST":[{"type":"file","fieldName":"file","multiple":true,"name":"file","sub":[{"name":"name","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"number"},{"name":"error","type":"text"}],"outputType":"array"}]},"exec":{"steps":{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}}}]}],"step":{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}}]},{"fileName":"lib/app.asp","lineNumber":114,"method":"_exec","args":[{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}]},{"fileName":"lib/app.asp","lineNumber":88,"method":"exec","args":[{"steps":{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}}]},{"fileName":"lib/app.asp","lineNumber":45,"method":"define","args":[{"meta":{"options":{"linkedFile":"/default.asp","linkedForm":"dropzone1"},"$_POST":[{"type":"file","fieldName":"file","multiple":true,"name":"file","sub":[{"name":"name","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"number"},{"name":"error","type":"text"}],"outputType":"array"}]},"exec":{"steps":{"name":"upload1","module":"upload","action":"upload","options":{"fields":"{{$_POST.file}}","path":"/upload","throwErrors":true},"meta":[{"name":"name","type":"text"},{"name":"path","type":"text"},{"name":"type","type":"text"},{"name":"size","type":"text"},{"name":"error","type":"number"}],"outputType":"array","output":true}}}]}]}

Thanks in advanced

Replied 03 May 2016 07:55:39
03 May 2016 07:55:39 Teodor Kuduschiev replied:
Please contact our live support, in order to resolve this issue.

Reply to this topic