Jump to content


Photo

Notícias


  • Faça o login para participar
6 replies to this topic

#1 Mateus Tosta

Mateus Tosta

    Normal

  • Usuários
  • 99 posts
  • Sexo:Não informado

Posted 11/02/2004, 07:33

Olá, eu tenho um sistema de notícias que se eu só colocar um texto, ele funciona perfeitamente, mas se eu tentar colocar uma imagem, ele me aponta o seguinte erro:

Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'Scripting.FileSystemObject'
/sistemasweb/temisnetnews/imagens/index.asp, line 92

A linha 92 do arquivo q ele se refere é essa:

Set fso = CreateObject("Scripting.FileSystemObject")


Aqui vai todo o arq. citado acima:

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<%
'***********************************************************************
'**          Sistema de Notícias desenvolvido pela TemisNet           **
'**           Contatos: Temístocles Sota  - ICQ 104458476             **
'**                    http://www.temisnet.com.br                     **
'***********************************************************************

response.buffer=true
Func = Request("Func")

nome= Request("nome")
if isempty(Func) Then
Func = 1
End if

Select Case Func
Case 1
response.redirect "../index.asp"
  
Case 2
ForWriting = 2
  adLongVarChar = 201
  lngNumberUploaded = 0

  noBytes = Request.TotalBytes
  binData = Request.BinaryRead (noBytes)

  Set RST = CreateObject("ADODB.Recordset")
  LenBinary = LenB(binData)

  if LenBinary > 0 Then
      RST.Fields.Append "myBinary", adLongVarChar, LenBinary
      RST.Open
          RST.AddNew
              RST("myBinary").AppendChunk BinData
          RST.Update
      strDataWhole = RST("myBinary")
  End if


strBoundry = Request.ServerVariables ("HTTP_CONTENT_TYPE")
lngBoundryPos = instr(1,strBoundry,"boundary=") + 8
strBoundry = "--" & right(strBoundry,len(strBoundry)-lngBoundryPos)

lngCurrentBegin = instr(1,strDataWhole,strBoundry)
lngCurrentEnd = instr(lngCurrentBegin + 1,strDataWhole,strBoundry) - 1
    
Do While lngCurrentEnd > 0

strData = mid(strDataWhole,lngCurrentBegin, lngCurrentEnd - lngCurrentBegin)
strDataWhole = replace(strDataWhole,strData,"")

  lngBeginFileName = instr(1,strdata,"filename=") + 10
  lngEndFileName = instr(lngBeginFileName,strData,chr(34))

  if lngBeginFileName = lngEndFileName and lngNumberUploaded = 0 Then
          Response.Write "<H2> The following Error occured.</H2>"
          Response.Write "You must Select at least one file To upload"
          Response.Write "<BR><BR>Hit the back button, make the needed corrections and resubmit your information."
          Response.Write "<BR><BR><INPUT type='button' onclick='history.go(-1)' value='<< Back' id='button'1 name='button'1>"
          Response.End
  End if

  if lngBeginFileName <> lngEndFileName Then
      strFilename = mid(strData,lngBeginFileName,lngEndFileName - lngBeginFileName)


      tmpLng = instr(1,strFilename,"\")
          
      Do While tmpLng > 0
          PrevPos = tmpLng
          tmpLng = instr(PrevPos + 1,strFilename,"\")
      Loop

      FileName = right(strFilename,len(strFileName) - PrevPos)

      lngCT = instr(1,strData,"Content-Type:")

      if lngCT > 0 Then
          lngBeginPos = instr(lngCT,strData,chr(13) & chr(10)) + 4
      Else
          lngBeginPos = lngEndFileName
      End if

      lngEndPos = len(strData)

      lngDataLenth = lngEndPos - lngBeginPos

      strFileData = mid(strData,lngBeginPos,lngDataLenth)

      Set fso = CreateObject("Scripting.FileSystemObject")
      
   total = len(FileName)   
   T = inStr(1,FileName,".") -1
      uin = nome & right(FileName,total - T)
      
      Set f = fso.OpenTextFile(server.mappath(".") & "\" & uin, ForWriting, True)
      
      f.Write strFileData
      Set f = nothing
      Set fso = nothing

      lngNumberUploaded = lngNumberUploaded + 1

  End if

  lngCurrentBegin = instr(1,strDataWhole,strBoundry)
lngCurrentEnd = instr(lngCurrentBegin + 1,strDataWhole,strBoundry) - 1
loop
response.redirect "../atualiza.asp?id="&nome&"&foto="&uin
End Select %>

Alguém pode me ajudar a fazer a imagem aparecer?

#2 Rodrigo

Rodrigo

    oi!

  • Usuários
  • 995 posts
  • Sexo:Não informado
  • Interesses:Diretório de sites - http://www.acheinobrasil.com.br

Posted 11/02/2004, 07:56

provavelmente pq seu server naum suporta FSO ;)

#3 Mateus Tosta

Mateus Tosta

    Normal

  • Usuários
  • 99 posts
  • Sexo:Não informado

Posted 11/02/2004, 08:52

Onde posso achar então um server que suporte FSO?

#4 Rodrigo

Rodrigo

    oi!

  • Usuários
  • 995 posts
  • Sexo:Não informado
  • Interesses:Diretório de sites - http://www.acheinobrasil.com.br

Posted 11/02/2004, 09:17

http://forum.wmonlin...showtopic=53800

#5 Mateus Tosta

Mateus Tosta

    Normal

  • Usuários
  • 99 posts
  • Sexo:Não informado

Posted 11/02/2004, 09:29

eu estou hospedando este sistema no websamba, mas não deu, vou dar uma olhada nos outros para ver o q acontece, valeu!

#6 BoB3000

BoB3000

    Novato no fórum

  • Usuários
  • 11 posts
  • Sexo:Não informado

Posted 11/02/2004, 10:53

E ae Mateus.....blz?? (y)


manda esse script pra gente tbm??? (y)

flw.....
BoB 3000

#7 Mateus Tosta

Mateus Tosta

    Normal

  • Usuários
  • 99 posts
  • Sexo:Não informado

Posted 11/02/2004, 12:34

Ai BOB, qual o metodo mais fácil pra mandar pra vc?




1 user(s) are reading this topic

0 membro(s), 1 visitante(s) e 0 membros anônimo(s)

IPB Skin By Virteq