fed0cb0975cded3eba2e9ac659809e3ba746403e.svn-base 859 B

1234567891011121314151617181920212223242526272829303132333435
  1. <%@LANGUAGE='VBSCRIPT' CODEPAGE='65001'%>
  2. <%
  3. option explicit
  4. Response.Expires = -1
  5. Response.Charset= "UTF-8"
  6. Server.ScriptTimeout = 600
  7. %>
  8. <!-- #include file="fileUploadClass.asp" -->
  9. <!-- #include file="config.asp" -->
  10. <!-- #include file="json.asp" -->
  11. <%
  12. SaveFiles()
  13. Function SaveFiles
  14. Dim Upload, json, i
  15. Set Upload = New fileUploadClass
  16. Upload.Save(UPLOAD_PATH)
  17. If Err.Number <> 0 Then Exit Function
  18. If Right(UPLOAD_URL, 1) <> "/" Then UPLOAD_URL = UPLOAD_URL & "/"
  19. Set json = New jsonParser
  20. Response.ContentType = "application/json"
  21. For Each i in Upload.UploadedFiles.keys
  22. With json.data
  23. .Add "fileUrl", UPLOAD_URL & Upload.UploadedFiles(i).FileName
  24. .Add "fileName", Upload.UploadedFiles(i).FileName
  25. .Add "fileSize", Upload.UploadedFiles(i).Length
  26. End With
  27. Response.Write json.JSONoutput()
  28. Next
  29. End Function
  30. %>