[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

08/28/2003 at 10:04PM PDT, ID: 20723419
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

resizing of image while uploading ?

Asked by Amita in Active Server Pages (ASP)

Tags: image, resize, upload

I am using some ASP code for uploading Images....I want to resize the images while uploading .... is it possible in ASP ? The code of uploading is as follows....I got it from net...

Server.ScriptTimeout = 500
Response.Expires=0
Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Dim UploadRequest, strTitle, intHeight, intWidth, strAltText, ContentType, intType,intFormat
Dim filename1
set UploadRequest = CreateObject("Scripting.Dictionary")
BuildUploadRequest  RequestBin
intFormat=UploadRequest.Item("THEFILE1").Item("Value")
UpLoadTheFileImage1

Function UpLoadTheFileImage1
      contentType = UploadRequest.Item("THEFILE1").Item("ContentType")
      filepathname = UploadRequest.Item("THEFILE1").Item("FileName")
      filename1 = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\"))
      filename1 = "T_" & second(time) * minute(time) & filename1
      Title_filename=filename1
      value = UploadRequest.Item("THEFILE1").Item("Value")
                Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")
      pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-17
      Set filesys = CreateObject("Scripting.FileSystemObject")
      fPath="C:\Inetpub\wwwroot\marlinrealestate\amor\Images\"
      bann= fPath & filename1
      path=bann
      Set MyFile = ScriptObject.CreateTextFile(bann)
      For i = 1 to LenB(value)
            MyFile.Write chr(AscB(MidB(value,i,1)))
      Next
      MyFile.Close
      UpLoadTheFileImage1=Title_filename
End Function

Sub BuildUploadRequest(RequestBin)
      'Get the boundary
      PosBeg = 1
      PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
      boundary = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
      boundaryPos = InstrB(1,RequestBin,boundary)
      'Get all data inside the boundaries
      Do until (boundaryPos=InstrB(RequestBin,boundary & getByteString("--")))
            'Members variable of objects are put in a dictionary object
            Dim UploadControl
            Set UploadControl = CreateObject("Scripting.Dictionary")
            'Get an object name
            Pos = InstrB(BoundaryPos,RequestBin,getByteString("Content-Disposition"))
            Pos = InstrB(Pos,RequestBin,getByteString("name="))
            PosBeg = Pos+6
            PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(34)))
            Name = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
            PosFile = InstrB(BoundaryPos,RequestBin,getByteString("filename="))
            PosBound = InstrB(PosEnd,RequestBin,boundary)
            'Test if object is of file type
            If  PosFile<>0 AND (PosFile<PosBound) Then
                  'Get Filename, content-type and content of file
                  PosBeg = PosFile + 10
                  PosEnd =  InstrB(PosBeg,RequestBin,getByteString(chr(34)))
                  FileName = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
                  'Add filename to dictionary object
                  UploadControl.Add "FileName", FileName
                  Pos = InstrB(PosEnd,RequestBin,getByteString("Content-Type:"))
                  PosBeg = Pos+14
                  PosEnd = InstrB(PosBeg,RequestBin,getByteString(chr(13)))
                  'Add content-type to dictionary object
                  ContentType = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
                  UploadControl.Add "ContentType",ContentType
                  'Get content of object
                  PosBeg = PosEnd+4
                  PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
                  Value = MidB(RequestBin,PosBeg,PosEnd-PosBeg)
            Else
                  'Get content of object
                  Pos = InstrB(Pos,RequestBin,getByteString(chr(13)))
                  PosBeg = Pos+4
                  PosEnd = InstrB(PosBeg,RequestBin,boundary)-2
                  Value = getString(MidB(RequestBin,PosBeg,PosEnd-PosBeg))
            End If
            'Add content to dictionary object
                      UploadControl.Add "Value" , Value      
            'Add dictionary object to main dictionary
            uploadRequest.Add name, UploadControl      
            'Loop to next object
            BoundaryPos=InstrB(BoundaryPos+LenB(boundary),RequestBin,boundary)
      Loop
      
End Sub
      
'String to byte string conversion
Function getByteString(StringStr)
       For i = 1 to Len(StringStr)
            char = Mid(StringStr,i,1)
            getByteString = getByteString & chrB(AscB(char))
       Next
End Function
      
'Byte string to string conversion
Function getString(StringBin)
       getString =""
       For intCount = 1 to LenB(StringBin)
            getString = getString & chr(AscB(MidB(StringBin,intCount,1)))
       Next
End Function

Or if there is any third party component(not ASPUPload) which can do image resizing..?
 
Keywords: resizing of image while uploading ?
 
Loading Advertisement...
 
[+][-]08/29/03 02:49 AM, ID: 9246596

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/03 02:45 AM, ID: 9256558

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Active Server Pages (ASP)
Tags: image, resize, upload
Sign Up Now!
Solution Provided By: ap_sajith
Participating Experts: 2
Solution Grade: B
 
 
[+][-]08/31/03 04:31 AM, ID: 9256758

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/31/03 05:06 AM, ID: 9256811

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09/16/03 01:04 AM, ID: 9368775

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06/05/04 09:55 PM, ID: 11242347

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74