The uploaded files are processed using ashx. This part of code can process any uploaded files and save them to the specified folder.
LocationID =; description =; success = (context. Request []! = Convert. ToInt32 (context. Request [(context. Request []! = Convert. ToString (context. Request [. Format (j =; j <uploadedFiles. Count; j ++ =. Format (uploadedFiles [j]! = & F1.ContentLength> filepath = DateTime. now. toString (path = ConfigurationSettings. appSettings []. toString () ++ filepath +. format (I =; I <uploadedFiles. count; I ++ = (uploadedFiles [I]! = & F. contentLength> upFileLength = contentType = [] FileArray = index = F. fileName. lastIndexOf (filename = F. fileName. replace (F. fileName. substring (pathUrl = path +. format (=. format (+View Code
Because the image is uploaded, it is saved directly to the folder. Of course, you can also save the compressed image to the database.
Medium
SaveimageToBase (length, success ===== width = height = target_width = target_height = target_ratio = () target_width/(image_ratio = () width/(target_ratio >== () math. floor (image_ratio * (= () Math. floor () target_width/= new_width> target_width? = New_height> target_height? = System. drawing. solidBrush (System. drawing. color. black), System. drawing. rectangle (, paste_x = (target_width-new_width)/paste_y = (target_height-new_height)/= DisasterImageSound Model ====. format (View Code
You can add parameters by calling the ashx Method url. Similarly, you can obtain it in ashx. The url is the address deployed in ashx, and Server. MapPath (+ filename) is the file.
url = ConfigurationSettings.AppSettings[= , Server.MapPath( + filename));