Avatar billede guzzie Nybegynder
01. januar 2001 - 15:43 Der er 21 kommentarer og
1 løsning

upload script

hi there

I have an upload script that i use and it works great.
however does anybody know if it is possible that I can choose where I upload to when i am uploading?
Something like when i click on \"upload\" i can choose which folder/map on my server it gets uploaded to

Guzzie(fra England)
Avatar billede netsrac Praktikant
01. januar 2001 - 15:47 #1
That might be possible.

Which script do you use to upload ?
Avatar billede smurfen Nybegynder
01. januar 2001 - 16:14 #2
you\'ll have to choose it before you upload and store it in a session variable because of the method used to transfer files via forms.. but you could do it.. :)
Avatar billede netsrac Praktikant
01. januar 2001 - 16:29 #3
Smurfen >> You can also tranfer data in a multipart form, it can be choosen where to place the upload at the same time as uploading.
Avatar billede nomiz Nybegynder
01. januar 2001 - 16:31 #4
Hvad med at lave eksperten.com på engelsk.. ? - Store penge, venner.. Store penge
Avatar billede netsrac Praktikant
01. januar 2001 - 16:33 #5
Så skal den jo nok hedde,

Theexpert.com

eller

Theexperts.com
Avatar billede guzzie Nybegynder
01. januar 2001 - 16:45 #6
Heh :)
I do read Danish but my written Danish sucks a little :)
/netsrac
Ok I use the basic upload script from www.azero.dk
site and have changed it a little so that I use cases instead of rediecting to another page
I just use the script for testing purposes and it is out of interest i thought that it could maybe be done ????
Ideas anyone
Avatar billede netsrac Praktikant
01. januar 2001 - 16:49 #7
Put in a text field and then it works, like this:

<html>
<body>

<form method=\"post\" enctype=\"multipart/form-data\" action=\"uploaded.asp\">
<input type=\"text\" name=\"uploadpath\">
  <input type=file name=\"file1\"><br>
  <input type=file name=\"file2\"><br>
  <input type=file name=\"file3\"><br>
  <input type=submit value=\"upload!\">
</form>

</body>
</html>

<html>
<body>
<%
  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
uploadpath = upload.form(\"uploadpath\")
  Count = Upload.Save(uploadpath)
  Response.Write Count & \" fil(er) modtaget.\"
%>
</body>
</html>

Avatar billede guzzie Nybegynder
01. januar 2001 - 17:10 #8
/netsrac

hey there:)

I tried that the server chewed on it a few seconds then i got an error message
this is the script as it stands now

I tried what you said but just got the error ;(


<%Case \"1\"%>
<table width=\"100%\" align=\"left\"><tr><td align=\"left\">
Directory: http://www.guzzie.dk/www/upload_asp/upload/...
<form method=\"post\" enctype=\"multipart/form-data\" action=\"upload.asp?sample=2\">
  <input type=file name=\"file1\"><br>
  <input type=file name=\"file2\"><br>
  <input type=file name=\"file3\"><br>
  <input type=submit value=\"upload\">
</form>
</td></tr></table>
<%Case \"2\"%>

<%
  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
  Count = Upload.Save(\"d:\\home\\guzziedk\\www\\upload_asp\\upload\")
  Response.Write Count & \" fil(er) modtaget.\"
%>

Avatar billede netsrac Praktikant
01. januar 2001 - 17:13 #9
What error message ?

You wrote the path on the server right ? not an http path ?
Avatar billede guzzie Nybegynder
01. januar 2001 - 17:20 #10
Hello :)
yep i tested with this path
d:\\home\\guzziedk\\www\\upload_asp\\upload

can you verify this part im not an expert so can you tell me where this

uploadpath = upload.form(\"uploadpath\")

should go in this script
<%
  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
  Count = Upload.Save(\"d:\\home\\guzziedk\\www\\upload_asp\\upload\")
  Response.Write Count & \" fil(er) modtaget.\"
%>

:)guzzie
Avatar billede netsrac Praktikant
01. januar 2001 - 17:24 #11
if you use this:
<%
  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
uploadpath = upload.form(\"uploadpath\")
  Count = Upload.Save(uploadpath)
  Response.Write Count & \" fil(er) modtaget.\"
%>
and make an text field in your upload form where you give the path where to save then i should upload without errors.

If not then copy & paste the error message here :-)

Avatar billede guzzie Nybegynder
01. januar 2001 - 17:30 #12
this is the script now

<%Case \"1\"%>
<table width=\"100%\" align=\"left\"><tr><td align=\"left\">
Directory: http://www.guzzie.dk/www/upload_asp/upload/...
<form method=\"post\" enctype=\"multipart/form-data\" action=\"upload.asp?sample=2\">
<input type=\"text\" name=\"uploadpath\">
  <input type=file name=\"file1\"><br>
  <input type=file name=\"file2\"><br>
  <input type=file name=\"file3\"><br>
  <input type=submit value=\"upload\">
</form>
</td></tr></table>
<%Case \"2\"%>

<%
  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
uploadpath = upload.form(\"uploadpath\")
  Count = Upload.Save(uploadpath)
  Response.Write Count & \" fil(er) modtaget.\"
%>


and this is the error message

Persits.Upload.1 error \'800a0005\'

Access is denied.

/upload_asp/upload.asp, line 36

this is the address of the page
http://www.guzzie.dk/upload_asp/upload.asp?sample=1

;) sniff
Avatar billede netsrac Praktikant
01. januar 2001 - 17:33 #13
Aha....Access is denied, that is because you do not have rights to upload pictures.
I use azero.dk myself, you shall use there support formular and ask for acces til uploading pictures.
Support Formular:
http://www.azero.dk/default.asp?/support/formular/
Avatar billede guzzie Nybegynder
01. januar 2001 - 17:38 #14
hi again :)

I wrote to them a while ago and got rights
and have been using this script to upload all sorts of files and pictures for a few weeks now so i doubt it is that
the script works fine
hmmmm
u can see here
http://www.guzzie.dk/upload_asp/upload.asp?sample=3
this works fine
;) sniff, sniff
Avatar billede netsrac Praktikant
01. januar 2001 - 17:40 #15
Just a secund, i will test myself :-)
Avatar billede guzzie Nybegynder
01. januar 2001 - 17:50 #16
I put the points up to 150 ;0
Avatar billede netsrac Praktikant
01. januar 2001 - 17:58 #17
I think i have an usefull solution now:

Make an tmp directery save the files here and then move them to the selected directory.
like this:

  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
Count = Upload.Save(\"d:\\home\\guzziedk\\www\\upload_asp\\upload\\tmp\")
    uploadpath = upload.form(\"uploadpath\")
    File.Copy uploadpath & File.ExtractFileName
    File.Delete


Response.Write Count & \" fil(er) modtaget.\"
Avatar billede guzzie Nybegynder
01. januar 2001 - 18:05 #18
hey again :)

i tried this it doesnt work either ;(
by tmp you mean a map that is called tmp?
if this is so then it doesnt work
;) sniff sniff
Avatar billede netsrac Praktikant
01. januar 2001 - 18:09 #19
yes i mean make an map called tmp under the map
d:\\home\\guzziedk\\www\\upload_asp\\upload\\

There was an error in the script, this should work :-)

  Set Upload = Server.CreateObject(\"Persits.Upload.1\")
Count = Upload.Save(\"D:\\home\\cnhdk\\www\\upload_test\\tmp\")
    uploadpath = upload.form(\"uploadpath\")
For Each File in Upload.Files
    File.Copy uploadpath & File.ExtractFileName
    File.Delete
next

Response.Write Count & \" fil(er) modtaget.\"
Avatar billede guzzie Nybegynder
01. januar 2001 - 18:23 #20
YEEHAAAAAA !!!!!!!!
many many thanks :)
u 1 cool dude :)
thank so much
Avatar billede netsrac Praktikant
01. januar 2001 - 18:24 #21
No problem :-)

Thanks for the points :-)
Avatar billede guzzie Nybegynder
01. januar 2001 - 18:26 #22
np :)
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