View Full Version : question with jscript & aspSmartUpload
bigdude
09-27-2002, 01:28 AM
hello
trying to use aspSmartUpload with jscript
but keep getting errors on mySmartUpload.Upload
have tried both
mySmartUpload.Upload;
mySmartUpload.Upload();
but still get error msgs
anyone know why or the proper syntax?
thanx in advance :)
cheers
whammy
09-27-2002, 03:24 AM
Not sure since it's a third party component... do you have the readme file?
bigdude
09-27-2002, 04:01 PM
hi
this is the only documentation they give on the method...
Upload
The Upload method.
Syntax
.Upload
Example
<%
Dim MyUpLoad
Set MyUpload = Server.CreateObject("AspSmartUpLoad.SmartUpLoad")
MyUpload.UpLoad
%>
any ideas?
:rolleyes:
Roy Sinclair
09-27-2002, 06:05 PM
You are probably having a problem with Case Sensitivity, you need to make sure you call the UpLoad function using the exact same case it's declared with (upload, Upload, UpLoad...) because Javascript is case sensitive while VBScript is not.
The problem is that the example shown could be using a different case than the declaration since the example is VBScipt so you may have to experiment to find it.
bigdude
09-27-2002, 06:57 PM
hi roy
thanks for the advice
tho, i tried different cases and that didn't seem to help
for anyone else trying to use jscript with aspsmartupload, this is what i got to work:
var mySmartUpload=Server.CreateObject("aspSmartUpload.SmartUpload");
mySmartUpload.AllowedFilesList="jpg,jpeg,JPG,JPEG,gif,GIF";
mySmartUpload.DenyPhysicalPath=true;
mySmartUpload.MaxFileSize=10000;
mySmartUpload.Upload();
mySmartUpload.Save("images/birds");
so it seems the () after .Upload is needed
also "images/birds" NOT "/images/birds" as in their eg, works for a path
thanks you guys for the help
cheers
whammy
09-27-2002, 11:51 PM
P.S. VBScript *IS* case-sensitive in some cases - I've noticed it seems even more so when the .NET client is installed, for some strange reason.
So it's always better to assume everything is case-sensitive so you don't get totally confused as to why something isn't working.
I can guarantee that this is true due to many hours of troubleshooting bugs and fixing them on 70+ websites for a particular client, and running into quite a few case-sensitivity issues (with variables!).
RaviVyas
11-24-2008, 04:02 PM
Thanks i need this code and i am searching from last 2 days :thumbsup:
I need one more help please
I need file name
please tell me how to get this in JScript
Thanks in Advance
hi roy
thanks for the advice
tho, i tried different cases and that didn't seem to help
for anyone else trying to use jscript with aspsmartupload, this is what i got to work:
var mySmartUpload=Server.CreateObject("aspSmartUpload.SmartUpload");
mySmartUpload.AllowedFilesList="jpg,jpeg,JPG,JPEG,gif,GIF";
mySmartUpload.DenyPhysicalPath=true;
mySmartUpload.MaxFileSize=10000;
mySmartUpload.Upload();
mySmartUpload.Save("images/birds");
so it seems the () after .Upload is needed
also "images/birds" NOT "/images/birds" as in their eg, works for a path
thanks you guys for the help
cheers
bigdude
12-01-2008, 05:39 PM
Hope this helps you.
if(!mySmartUpload.Files("fileImageCD").IsMissing)
{
mySmartUpload.Save("../images/cd");
insertImagePath=mySmartUpload.Files("fileImageCD").FileName;
insertImageFileName=mySmartUpload.Files("fileImageCD").FileName;
}
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.