rbi.logFile("upload=======start") Dim regID As Integer Dim from_id As String = "" Dim Filename As String = "" Dim FileExtension As String = "" Dim type As String = "" Dim FilePath As String = "" Dim ThumbnailsPath As String = "" Dim SavedFilename As String = "" Dim msg As String = "" Dim size As String = "" Dim ImagesExt As String = conf.getXmlConfig("IMAGESEXTENSIONS").ToUpper Try 'get header parameters regID = Request.Headers.Get("MSG") msg = Request.Headers.Get("MSG") type = Request.Headers.Get("TYPE") 'for android users If type = "3" Then msg = System.Web.HttpUtility.UrlDecode(msg) End If 'from server to server 'Dim PARAM As String = "IMEI=" & imei & "&IMSI=" & imsi 'Dim url As String = "http://api.storenshare.co/GETID.aspx?" & PARAM 'rbi.logFile("upload=======" & url) 'Dim data As String = c.ReadHtmlPage(url, imei & "]" & imsi) 'Dim StringValue As String() = data.Split("]") 'rbi.logFile("upload=======data===" & data) 'from_id = Trim(StringValue(0)) 'from_mo = Trim(StringValue(1)) 'get favortie ids to share Dim TOIDS As String = Request.Headers.Get("TOID") rbi.logFile("upload=======TOIDS===" & TOIDS) Filename = Request.Headers.Get("FileName") rbi.logFile("upload=======filename===" & Filename) ' FileExtension = Request.Headers.Get("EXT") type = Request.Headers.Get("TYPE") size = Request.Headers.Get("size") 'get the image Dim str As System.IO.Stream str = Request.InputStream Dim strLen As Integer strLen = CInt(str.Length) Dim strArray(strLen) As Byte str.Read(strArray, 0, strLen) str.Close() If IsNothing(str) = False Then str.Dispose() End If If strArray.Length < 2 Then Session("return") = "-1" 'Response.Write(Session("return")) Exit Sub End If size = strArray.Length Dim downloadpath As String = "" ' Dim downloadlink As String = "https://share.storenshare.co/folders" & "/" & from_id & "/Files/" 'save image in a specific path FilePath = conf.getXmlConfig("USERSFOLDER") & "\" & from_id & "\Files\" Dim linkpath2 As String = conf.getXmlConfig("linkfolder") & "/" & from_id & "/Files/" Dim linkpath As String = "E:\STORE_FILES" & "\" & from_id & "\Files\" ThumbnailsPath = "E:\STORE_FILES" & "\" & from_id & "\thumbs\" Dim szThumbsFlag As String = "0" Session("return") = conf.WriteToFileByte(from_id, Filename, strArray, FilePath, SavedFilename, FileExtension) downloadpath = linkpath & SavedFilename & FileExtension If ImagesExt.IndexOf("|" & FileExtension.ToUpper & "|") > -1 Then Try ThumbnailsPath = linkpath & "thumbnails\" & SavedFilename & FileExtension If Not conf.generateThumbnail(linkpath, linkpath & "thumbnails\", SavedFilename & FileExtension) Then rbi.logFile("generateThumbnail========" & "not thumb") End If Catch Session("return") = "-1" Finally End Try End If 'database code 'Dim requestvar As String = from_id & "]" & TOIDS & "]" & Filename & "]" & FileExtension & "]" & downloadpath & "]" & size & "]" & from_mo & "]" & msg & "]" & ThumbnailsPath 'url = "http://api.storenshare.co/file_upload.aspx" 'Data = c.ReadHtmlPage(url, requestvar) 'Session("return") = Data Catch ex As Exception Session("return") = ("-1") rbi.logFile("upload====EXCEPTION====" & ex.ToString) Finally rbi.logFile("upload=======response=====" & Session("return")) Response.Write(Session("return")) Response.End() End Try
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)