Welcome to MobyThreads.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in
All support for the MobyThreads Threaded phpBB MOD can now be found on welsolutions at this forum

HowTo Send Uploaded File with INPUT Type file to Sql Serv..

 
   Web Hosting and Web Master Forums (Home) -> IIS RSS
Next:  right version of IIs for XP and Frontpage 2002  
Author Message
rob5

External


Since: Sep 30, 2003
Posts: 5



(Msg. 1) Posted: Wed Oct 15, 2003 7:37 pm
Post subject: HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type ?
Archived from groups: microsoft>public>inetserver>iis (more info?)

I have the following problem:

I have the following form client side:

<FORM.......>

<FORM action="./WZUpload.asp" method="Post" enctype="multipart/form-data"
WIDTH=100%>
<INPUT Type="file" name="UpFileName" STYLE="{Width:400px}"><BR>

I have the following ASP code server side ....

AllDataB = Request.BinaryRead()

AllData = ConvertToStringFromByte(AllDataB)

AllDataFile = pGetRequestItem(AllData....) ' THIS INSTRUCTION FIND FILE
BINARY DATA.....

I need to transform SAFE ARRAY AllDataB in a Vb string because it's
necessary for me to find Header info and because AllDataB doesn't contain
only FILE BINARY DATA but other informations.

Now I want to insert DIRECTLY File Binary Data (in the variable AllDataFile)
in a Sql Server Image field without writing AllDataFile to a local file
using the FileSysteObject.

If I write:

Rs("ImageField").AppendChunk AllDataFile

IT DOESN'T WORK: the data format is UNICODE. And If I open the file the
format is UNRECOGNIZED.

Is There a Mode to insert directly data from BinaryRead to Sql Server Image
data type ?

If I write data from binaryread to a local file with FILESYSTEMOBJECT and I
read it with ADODB.STREAM and I write ADODB.STREAM content to SQL SERVER
IMAGE DATA TYPE it works but it's VERY VERY slow with large files.

Thanks Rob

 >> Stay informed about: HowTo Send Uploaded File with INPUT Type file to Sql Serv.. 
Back to top
Login to vote
lukezhan

External


Since: Oct 16, 2003
Posts: 1



(Msg. 2) Posted: Thu Oct 16, 2003 8:32 am
Post subject: RE: HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Rob,

You may try following code to see if it will help:

Set objADO = CreateObject("ADODB.Stream")
objADO.Open
objADO.Type = 1
objADO.Write Request.BinaryRead(Request.TotalBytes)

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 >> Stay informed about: HowTo Send Uploaded File with INPUT Type file to Sql Serv.. 
Back to top
Login to vote
rob5

External


Since: Sep 30, 2003
Posts: 5



(Msg. 3) Posted: Thu Oct 16, 2003 1:30 pm
Post subject: Re: HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Ok. But Request.BinaryRead doesn't contain only binary data of FILE but
other information : for example
CONTENT - TYPE
CONTENT - DISPOSITION....

etc etc.....
Now I must position at the begin of Binary Data.....I have tried with INSTRB
and MIDB but if I call INSTRB with Binary Data it goes in crash.

Rob.

""台灣微軟技術處支援部"" <lukezhan.TakeThisOut@online.microsoft.com> wrote in message
news:9TsQZb6kDHA.1544@cpmsftngxa06.phx.gbl...
 > Hi Rob,
 >
 > You may try following code to see if it will help:
 >
 > Set objADO = CreateObject("ADODB.Stream")
 > objADO.Open
 > objADO.Type = 1
 > objADO.Write Request.BinaryRead(Request.TotalBytes)
 >
 > Luke
 > Microsoft Online Support
 >
<font color=purple> > Get Secure! <a style='text-decoration: underline;' href="http://www.microsoft.com/security</font" target="_blank">www.microsoft.com/security</font</a>>
 > (This posting is provided "AS IS", with no warranties, and confers no
 > rights.)
 >
 ><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: HowTo Send Uploaded File with INPUT Type file to Sql Serv.. 
Back to top
Login to vote
lukezhan1

External


Since: Oct 18, 2003
Posts: 3



(Msg. 4) Posted: Sat Oct 18, 2003 10:16 am
Post subject: Re: HowTo Send Uploaded File with INPUT Type file to Sql Server Image Data Type [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Rob,

To remove the redundant data, you may refer to following article for third
party solution or pure script solution:

http://www.aspfaq.com/show.asp?id=2189

Addtionally, there is also a way with MSXML:

http://www.15seconds.com/issue/010522.htm

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 >> Stay informed about: HowTo Send Uploaded File with INPUT Type file to Sql Serv.. 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
PRoblem: Website Dev Serv to Prod: How do map localhost/ap.. - Newbie question: I'm developing web app on Win XP Pro using VS.NET/IIs5.1. Vittual path is http://localhost/appname and thus all references to development files must include the app path. However, I dont want to have to specify ..

New problem with input form - I have a form that I have been using for almost a year that collects data and puts the data collected, through an odbc connection, into an SQL server database. It has been working up until about a week ago. The form is a vbscript form. I installed..

IIS File security - I have a website installed on IIS 5.0. I want to restrict access to certail resourses only to users who logged in to the site. I do this through the session. It is not a problem when im dealing with asp pages, but who can i enforce protection on other..

IIS 6.0 File Mappings - My system configuration is Windows 2003 Server Running IIS 6.0. I am trying to get compiled EXE files and C++ CGI files to run on my site, however I keep getting 404 errors. There are no mappings for either .cgi or .exe in the application mappings. Do....

Redirecting zip file - Hi All, Good Morning, The problem which i am facing is related with IIS 6.0 in Win2K3. The problem: I have a ASP page which redirect a zip file which resides in the Application data path, while access this page i am getting the....
   Web Hosting and Web Master Forums (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]