הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   הקטנת תמונות, מה כבר לא טוב בקוד?? (https://hosts.co.il/forums/showthread.php?t=56429)

Bear Cub 13-11-07 14:59

הקטנת תמונות, מה כבר לא טוב בקוד??
 
כדי להציג תמונה מוקטנת עד השלב לפני שאני קורא לפונקציה: 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

%> 


Bear Cub 14-11-07 11:31

יכול להיות שזה בעיה של הרשאות בשרת של החברת איחסון?

DanielS 14-11-07 16:15

רשום Write to file failed. . עשית הרשאות 777 לקובץ שאותו אתה עורך ?
זה מה שנראה לי הגיוני.
כי אין לי מושג בASP אבל צריך הרשאה כדי לערוך קובץ בכל שפה

Bear Cub 14-11-07 18:06

אחי, זה ASP זה שרת WINDOWS לא לינוקס, אין בזה הרשאות קבצים כאלה. רק מהשרת עצמו אם אני לא טועה


כל הזמנים הם GMT +2. הזמן כעת הוא 09:58.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ