PDA

View Full Version : File upload


Spudhead
12-11-2002, 06:46 PM
Hi,

I'm using dundas upload (http://www.dundas.com) and getting a http 500 server error.


var upld = Server.CreateObject("Dundas.Upload.2");
//upld.MaxUploadSize=5000000;
upld.UseUniqueNames=false;
upld.UseVirtualDir=false;

var prTitle=escape(Request.Form("prTitle"));
var prFilepath=String(Request.Form("prFilepath"));
var prFilename="";

Response.Write(prTitle+"<br>"+prFilepath+"<br>");


if(prFilepath!=""){
var splitPath=prFilepath.split("\\");
prFilename=String(splitPath[splitPath.length-1]);

var serverPath=Server.MapPath("index.asp");
var splitServer=serverPath.split("\\");
var savePath="";

for(i=0;i<splitServer.length-1;i++){
savePath+=splitServer[i];
savePath+="\\";
}
savePath+="pres\\";
//savePath+=prFilename;

//upld.Save(savePath)
Response.Write(savePath);
}


I've tried going through and commenting out line by line. It's definitely getting as far as upld.Save(). As it is, it writes savePath fine; an ordinary looking path to the correct directory, starting "C:\" and ending "www\pres\".

It might be file permissions - but I, um, don't know how to set write permission via FTP in DOS. Anyone?

whammy
12-12-2002, 12:03 AM
What's the error you're getting? Have you unchecked "Show friendly HTTP errors" in your tools/internet options/advanced settings in your IE browser? That should give you the exact error, which may or may not (but it's definitely worth a shot) help in debugging.

Spudhead
12-12-2002, 12:54 PM
Hmm - good point, I'd forgotten about that. Didn't work all day at home yesterday; I'm at work today and it works fine. I have no idea what caused the error but I think I need to try it on a few machines...

Ta :)