Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: MOD Implementation
 !!HELP!! No Upload File MOD is not working for me
 New Topic  Topic Locked
 Printer Friendly
Next Page
Author Previous Topic Topic Next Topic
Page: of 2

seanxushen
Starting Member

13 Posts

Posted - 27 June 2006 :  04:35:25  Show Profile
All Upload File MODs are not working for me, I have at least tried three different file upload MODs in the forum, but none of those works for me.

I can upload Text file without any problem, but once binary file is uploaded I will see the following error message.

This is the error message:
-----------------------------------------------
Microsoft VBScript runtime error '800a0005'

Invalid procedure call or argument

/forum/start/outputFile.asp٬line 260
----------------------------------------



Below is related code:
----------------------------------------------------------

'Create and Write to a File

Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & strUploadUrl & "\" & membername & "\" & filename)

For i = 1 to LenB(value)
MyFile.Write Chr(AscB(MidB(value,i,1)))
Next

MyFile.Close
------------------------------------------------------

As all of upload file mods used this part of the code, I am kind of hopeless now.

By searching this forum, I have found at least two other people are having same kind of problem. But none of them got an answer for this problem. I have also searched Google, and found few people are experience same problem, but no one actually resolved the problem. (I have tried change chr to chrW as mentioned in one of post in Google, but did not help in my case)..


Regards
Sean

Edited by - seanxushen on 27 June 2006 04:35:54

brian33433
New Member

60 Posts

Posted - 27 June 2006 :  11:39:59  Show Profile  Visit brian33433's Homepage
the script is right, double check your permissions and allowable extentions

When it happens after dark, its twice as nice...
http://nightclubtonight.com

Edited by - brian33433 on 27 June 2006 11:43:13
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 27 June 2006 :  12:11:02  Show Profile
quote:
Originally posted by brian33433

the script is right, double check your permissions and allowable extentions



I am not that stupid, the permission and allowable extensions are set up correctly.

Looks like MyFile.Write Chr() could not accept binary values. By searching the internet, I have found many people have the similar problem. But one has a clue how to fix the problem..
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 27 June 2006 :  13:05:26  Show Profile  Visit HuwR's Homepage
you haven't said which line is line 260, so how do expect us to offer a suggestion if we don't know which line is causing the error to be thrown
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 27 June 2006 :  20:25:22  Show Profile
MyFile.Write Chr(AscB(MidB(value,i,1)))

This is line 260.

Looks like that I could not pass the binary values to the function, But Text values are OK..

Does filesystemobject actually support binary files? If answer is yes, why I am having the problem. If answer is no, why most people do not have any issues..

I really need some help..

Edited by - seanxushen on 27 June 2006 20:28:57
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 27 June 2006 :  23:44:27  Show Profile  Visit AnonJr's Homepage
Not sure if it makes a difference, but are you running on a Windows server or are you running on *nix with Sun One or one of the other emulators?
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 28 June 2006 :  00:32:24  Show Profile
I am hosting my web site at a Virtual NT based server, and I believe that NT server is using Chinese based Windows system.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 28 June 2006 :  04:57:42  Show Profile  Visit HuwR's Homepage
the filesystemobject does not work with binary files, for some info on saving binary files, check out http://www.motobit.com/tips/detpg_read-write-binary-files/
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 28 June 2006 :  10:15:59  Show Profile
OK, if filesystemobject does not work with binary files, how those MOD (eg. proeders file attachment MOD, Mike file attachement MOD) have been writen using this object and no one is complaining except me?

I know ADO.Stream could be used to re-program to better support binary files, but because I have little knowledge on ASP programing, and I won't be able to do it myself.
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 28 June 2006 :  11:00:51  Show Profile  Visit AnonJr's Homepage
quote:
Originally posted by seanxushen

I am hosting my web site at a Virtual NT based server, and I believe that NT server is using Chinese based Windows system.


It may just be me misunderstanding you're post, but when you say 'NT based server' do you mean "NT based" like "Windows 2000 and Server 2003" or do you mean "NT based" as in "NT4"?

I ask because virtual server or not, the version of IIS, ASP, VBScript, and the OS itself could be part of the problem...
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 28 June 2006 :  19:43:55  Show Profile
quote:
Originally posted by AnonJr

quote:
Originally posted by seanxushen

I am hosting my web site at a Virtual NT based server, and I believe that NT server is using Chinese based Windows system.


It may just be me misunderstanding you're post, but when you say 'NT based server' do you mean "NT based" like "Windows 2000 and Server 2003" or do you mean "NT based" as in "NT4"?

I ask because virtual server or not, the version of IIS, ASP, VBScript, and the OS itself could be part of the problem...



It is Virtual Server. The OS is Chinese based Windows server 2003. I don't know IIS, ASP and VBScript though..

Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 28 June 2006 :  19:47:19  Show Profile
quote:
Originally posted by HuwR

the filesystemobject does not work with binary files, for some info on saving binary files, check out http://www.motobit.com/tips/detpg_read-write-binary-files/



I almost certain now, my hosting OS do not support binary writing in FSO. Anyone here can help me to re-write the code using

Function SaveBinaryData(FileName, ByteArray)
Const adTypeBinary = 1
Const adSaveCreateOverWrite = 2

'Create Stream object
Dim BinaryStream
Set BinaryStream = CreateObject("ADODB.Stream")

'Specify stream type - we want To save binary data.
BinaryStream.Type = adTypeBinary

'Open the stream And write binary data To the object
BinaryStream.Open
BinaryStream.Write ByteArray

'Save binary data To disk
BinaryStream.SaveToFile FileName, adSaveCreateOverWrite
End Function

to replace

Set MyFile = ScriptObject.CreateTextFile(Left(Server.mappath(Request.ServerVariables("PATH_INFO")),pathEnd) & strUploadUrl & "\" & membername & "\" & filename)

For i = 1 to LenB(value)
MyFile.Write Chr(AscB(MidB(value,i,1)))
Next

MyFile.Close


I have little ASP knowlesge, and could not figure our how to do it..
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 28 June 2006 :  22:04:34  Show Profile  Visit AnonJr's Homepage
quote:
Originally posted by seanxushen

Windows server 2003.


That's what I was checking.
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 28 June 2006 :  23:59:27  Show Profile
quote:
Originally posted by AnonJr

quote:
Originally posted by seanxushen

Windows server 2003.


That's what I was checking.



What you mean by you were checking?
Go to Top of Page

AnonJr
Moderator

United States
5768 Posts

Posted - 29 June 2006 :  00:32:04  Show Profile  Visit AnonJr's Homepage
I wasn't concerned about the Virtual Server part. It sounded almost like you said you were running on NT as in "NT4" (that misunderstanding could have been due to a lack of coffee on my part too) NT4 came with an older version of ASP and doesn't support certain aspects of ASP/VBScript. It was a long-shot, but worth checking anyway.
Go to Top of Page

seanxushen
Starting Member

13 Posts

Posted - 29 June 2006 :  01:51:18  Show Profile
quote:
Originally posted by AnonJr

I wasn't concerned about the Virtual Server part. It sounded almost like you said you were running on NT as in "NT4" (that misunderstanding could have been due to a lack of coffee on my part too) NT4 came with an older version of ASP and doesn't support certain aspects of ASP/VBScript. It was a long-shot, but worth checking anyway.



Thanks for your help. I almost certain now that is the CHinese OS causing binary write in FSO to be failed. The only hope right now for me is someone could help to re-write outputfile.asp in proeders file attachment MOD or Mike file attachement MOD using adodb stream function.

Many thanks..


regards
Sean
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Next Page
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.32 seconds. Powered By: Snitz Forums 2000 Version 3.4.07