View Single Post
ישן 13-11-07, 14:59   # 1
Bear Cub
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Oct 2005
גיל: 34
הודעות: 429
שלח הודעה באמצעות ICO אל Bear Cub שלח הודעה באמצעות MSN אל Bear Cub

Bear Cub לא מחובר  

Exclamation הקטנת תמונות, מה כבר לא טוב בקוד??

כדי להציג תמונה מוקטנת עד השלב לפני שאני קורא לפונקציה: SaveBinaryData
זה עובד מעולה והתמונה מוקטנת. הקטע הוא שאני לא רוצה להקטין אותה באמצעות הדף אלא כקובץ בשרת עצמו. התמונה כבר בשרת, לא צריך להעלות אותה.
השגיאה שמופיעה זה:
ADODB.Stream error '800a0bbc'

Write to file failed.

/simple_resizer3.asp, line 43

מישהו יכול לעזור?

תודה.

PHP קוד:
<%
   
'***************************************************************************
   ' 
e-Kov Software Picture Effector 2.7 tutorial script (c2001-2004
   
' Mailto: support@e-Kov.com
   ' 
WWW:        www.e-Kov.com
   
' Resample source picture to width 150px
   '
***************************************************************************
path="/yay.jpg"

   
Dim ObjnewWidthnewHeight
   Set Obj 
Server.CreateObject("eKov.PictureEffector")
   
Obj.LoadFromFile Server.MapPath(Path)
   
newWidth  180
   newHeight 
newWidth Obj.Height Obj.Width
   Obj
.Resize  newWidthnewHeight5
   Obj
.Quality 90

path
="/yay2.jpg"

  
SaveBinaryData Server.MapPath(Path), Obj.GetImageAsJpeg

     Set Obj 
nothing



Function SaveBinaryData(FileNameByteArray)
  Const 
adTypeBinary 1
  
Const adSaveCreateOverWrite 2
  
Const adSaveCreateNotExist 1

  
'Create Stream object
  Dim BinaryStream
  Set BinaryStream = CreateObject("ADODB.Stream")

  '
Specify stream type we want To save binary data.
  
BinaryStream.Type adTypeBinary

  
'Open the stream And write binary data To the object
  BinaryStream.Open
  BinaryStream.Write ByteArray

  '
Save binary data To disk
  BinaryStream
.SaveToFile FileNameadSaveCreateOverWrite
  BinaryStream
.SaveToFile FileNameadSaveCreateNotExist
End 
Function

%> 
  Reply With Quote