• 0
Sign in to follow this  
smez

Erro No Upload

Question

estou com uma duvida no sistema de upload

o sistema ta funcionando

<%
Response.Expires = -1000
Response.Buffer = True

Response.Buffer = TRUE
Response.Clear
byteCount = Request.TotalBytes
RequestBin = Request.BinaryRead(byteCount)
Dim UploadRequest
Set UploadRequest = CreateObject("Scripting.Dictionary")

BuildUploadRequest  RequestBin
' Recuperando os Dados Digitados ----------------------
de = UploadRequest.Item("de").Item("Value")
para = UploadRequest.Item("para").Item("Value")
msg = UploadRequest.Item("msg").Item("Value")

contentType = UploadRequest.Item("foto").Item("ContentType") 
filepathname = UploadRequest.Item("foto").Item("FileName") 
filename = Right(filepathname,Len(filepathname)-InstrRev(filepathname,"\")) 
filename = Replace(filename,".","_"& rndit &".") 
value = UploadRequest.Item("foto").Item("Value")

Set ScriptObject = Server.CreateObject("Scripting.FileSystemObject")

'FAZ O UPLOAD DAS IMAGENS EM UMA PASTA (/mural).
 pathEnd = Len(Server.mappath(Request.ServerVariables("PATH_INFO")))-14
       Set MyFile = ScriptObject.CreateTextFile(Server.mapPath("mural/"&filename&""))
   
 For i = 1 to LenB(value) 
  MyFile.Write chr(AscB(MidB(value,i,1)))
 Next
 MyFile.Close
'renomeia ao arquivo
Function rndit()
	Dim RndTemp 
	Randomize 
	RndTemp = Rnd * 100 
	RndTemp= Int(RndTemp) 
	rndit = RndTemp 
End Function 
%>
<%	Dim adoConn

Set adoConn = Server.CreateObject("ADODB.Connection")
adoConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\Inetpub\smez\db\movimento.mdb'"
Dim newcode
Set newcode = Server.CreateObject("ADODB.Recordset")
newcode.Open "mural", adoConn, 2, 2, 2
newcode.AddNew
newcode("de") = de
newcode("para") = para
newcode("msg") = msg
newcode("foto") = filename
newcode.Update
newcode.close
set newcode = nothing
%>

o erro que esta dando e o seguinte

Tipo de erro:

Erro de tempo de execução do Microsoft VBScript (0x800A0046)

Permissão negada

/movimento/enviar_mural.asp, line 45

quando a pessoa não envia a foto

como eu faço para arrumar isso.

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this