Avatar billede guzzie Nybegynder
13. marts 2001 - 16:00 Der er 15 kommentarer og
1 løsning

upload error

hey there
I have a syntax error in my upload script

Upload.Save \"d:\\home\\guzziedk\\www\\film_site\\upload\\\'\"&upload.form(\"pass\")&\'\"

this is the error i get

Microsoft VBScript compilation error \'800a03ea\'

Syntax error

/film_site/upload_pics.asp, line 6

Upload.Save \"d:\\home\\guzziedk\\www\\film_site\\upload\\\'\"&upload.form(\"pass\")&\'\"


Any ideas ?? :)
Guzzie
Avatar billede netsrac Praktikant
13. marts 2001 - 16:01 #1
Upload.Save \"d:\\home\\guzziedk\\www\\film_site\\upload\\\"&upload.form(\"pass\")
Avatar billede guzzie Nybegynder
13. marts 2001 - 16:06 #2
thanks netsrac
if I can pick your brain a little more
i have a response write further down in my script
and the img path also gives me an error
src=upload/\"&upload.form(\"pass\")\"/

Hope you dont mind :)
Guzzie
Avatar billede netsrac Praktikant
13. marts 2001 - 16:08 #3
src=upload/\"&upload.form(\"pass\") & \"/
Avatar billede guzzie Nybegynder
13. marts 2001 - 18:10 #4
hey there netsrac
your answer
Upload.Save \"d:\\home\\guzziedk\\www\\film_site\\upload\\\'\"&upload.form(\"pass\")&\'\"

works fine but only uploads to upload and not the next folder ??

I changed it to
Upload.Save \"d:\\home\\guzziedk\\www\\film_site\\upload\\\"&upload.form(\"pass\") & \"\\\"

but this doesn´t work either :( it still only uploads to upload
do you have any ideas
Guzzie
Avatar billede netsrac Praktikant
13. marts 2001 - 18:13 #5
Er du sikker på at upload.form(\"pass\") indeholder noget ?
Avatar billede guzzie Nybegynder
13. marts 2001 - 18:44 #6
this is the whole page it had always worked fine
<%
Set Upload = Server.CreateObject(\"Persits.Upload.1\")

Upload.OverwriteFiles = False
Upload.SetMaxSize 1048576
Upload.Save \"d:\\home\\guzziedk\\www\\film_site\\upload\\\"&upload.form(\"pass\") & \"\\\"

For Each File in Upload.Files

If File.ImageType <> \"GIF\" and File.ImageType <> \"JPG\" Then
  Response.Write \"GIF or JPG files only please!\"
  Exit For
End If
If File.ImageWidth > 1500 Then
  Response.Write \"Image width cannot exceed 1500 pixels.\"
  Exit For
End If

If File.ImageHeight > 1600 Then
  Response.Write \"Image height cannot exceed 1600 pixels.\"
  Exit For
End If

    Set Conn = Server.CreateObject(\"ADODB.Connection\")
    Conn.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath (\"media.mdb\")
    strSQL=\"INSERT into pics (pass, pic1) Values(\'\"&upload.form(\"pass\")&\"\',\'\" & File.ExtractFileName & \"\')\"
    Conn.Execute(strSQL)
response.write \"<link rel=stylesheet style=text/css href=styles_old.css><body>\"
response.write \"<table valign=top align=center width=550 cellpadding=5 cellspacing=0>\"
response.write \"<tr><td colspan=3><img id=img src=upload/\"&upload.form(\"pass\") & \"/\" & File.ExtractFileName & \" border=0 width=110 height=100 align=left hspace=10>Dit billed <b>\" & File.ExtractFileName & \"</b> ligger klar på vores server.<br><br>Hvis du ønsker at uploade flere billeder kan du klikke &nbsp;&nbsp;<a href=java script:history.go(-1)>h&eacute;r</a>.<br><br>For at aktivere din bestilling, indtast din email, hvorefter du vil blive sendt tilbage til vores forside.</td></tr>\"
response.write \"<tr><td colspan=3><hr></td></tr>\"
response.write \"<tr><td align=right><form action=mail_pic_activate.asp method=post><input id=form type=hidden name=activate value=activate><input type=hidden name=pass value=\"&upload.form(\"pass\")&\"></td></tr>\"
response.write \"<tr><td align=right>Indtast Email:</td><td align=left><input id=form size=30 type=text name=email></td><td align=left><input id=form type=submit name=submit value=Aktiv&eacute;r&nbsp;bestilling></td></tr></form>\"
response.write \"<tr><td colspan=3><hr></td></tr>\"
response.write \"<tr><td colspan=3>&nbsp;</td></tr></table>\"
Next
%>

As you can see I upload and write to my db
but since I am trying with the new upload path it
only uploads to upload ?
hmm
Guzzie
Avatar billede netsrac Praktikant
13. marts 2001 - 18:49 #7
Prøv dette:
path = \"d:\\home\\guzziedk\\www\\film_site\\upload\\\"&upload.form(\"pass\") & \"\\\"

Upload.Save path

response.write path

Avatar billede guzzie Nybegynder
13. marts 2001 - 18:53 #8
hmmm yes that is strange
the path on the page is shown as this

d:\\home\\guzziedk\\www\\film_site\\upload\\\\

hmmm
Guzzie
Avatar billede netsrac Praktikant
13. marts 2001 - 18:57 #9
Så må du ikke få værdien med over, tjek din form for navnet.
Avatar billede guzzie Nybegynder
13. marts 2001 - 19:03 #10
hmm I have just doubled checked again
And the form is fine and it also writes/uploads to the DB but the upload path is still uploading only to upload ?
Damn this is strange :[
Guzzie
Avatar billede netsrac Praktikant
13. marts 2001 - 19:06 #11
repath = upload.form(\"pass\")
path = \"d:\\home\\guzziedk\\www\\film_site\\upload\\\"&repath& \"\\\"

Upload.Save path

response.write path
Avatar billede guzzie Nybegynder
13. marts 2001 - 19:18 #12
hehe Nope
it still dont work ;(
hmmm
still the same
it like the value isn´t being inserted in the path
damn strange
Guzzie
(maybe I should create a new question since you are using quite a bit of time on this? )
Avatar billede netsrac Praktikant
13. marts 2001 - 19:22 #13
Det fatter jeg ikke, det burde virke.

Prøv response.write upload.form(\"pass\")
Avatar billede guzzie Nybegynder
13. marts 2001 - 19:31 #14
LOLOL
I dont understand either
response.write upload.form(\"pass\")

returns upload.form(\"pass\") perfectly
in this case \"pass\" has a value of \"fuckme\"
and the response.write shows it perfectly

Guzzie
Avatar billede guzzie Nybegynder
13. marts 2001 - 19:38 #15
Of course it still only uploads to upload folder
:(
But its still strange that it would find the value
Avatar billede netsrac Praktikant
13. marts 2001 - 19:41 #16
Dammit...
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester