Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,154,148 members, 7,821,919 topics. Date: Wednesday, 08 May 2024 at 09:46 PM

I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U (1583 Views)

Android App Developer That No About Webservice Come In And Help / How To Use Webservice Wsdl File In PHP / Providing Nigerian Stock Market Price Webservice + Online Dataservices (2) (3) (4)

(1) (Reply) (Go Down)

I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by luckyCO(m): 11:43am On Dec 19, 2007
I want to design a webservice that can enable me send data to and from client machine. I sed code below but it was giving me errors. I changed FileStream to StreamWriter and StreamReader, it complained about using C drive since I dont have access to it Dim fs1 As New FileStream("C:\" & fo.Name, FileMode.Create).

When I changed Dim fs1 As New FileStream("C:\" & fo.Name, FileMode.Create) to dim fs1 as new StreamWriter(path & fiename) and it worked but when I open the file it gives me strange xters.

Please help me look at the code below and suggest possible solutions if not a new idea.

Again it there anyway I could know scanners connected to my computer?

Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.IO
<WebService(Namespace:="http://mysite.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> <System.Serializable()> _
Public Class Service
Inherits System.Web.Services.WebService

<WebMethod()> _
Public Function FilePosted(ByVal Filename As String) As String


Try
Dim path As String = Context.Server.MapPath("~/"wink
Dim fo As New FileInfo(Filename)
Dim fs As New FileStream(Filename, FileMode.Open)

Dim fs1 As New FileStream("C:\" & fo.Name, FileMode.Create)
Dim nBytes As Integer = fs.Length
Dim ByteArray(nBytes) As Byte


Do While Not fs.Read(ByteArray, 0, nBytes) = 0
fs1.Write(ByteArray, 0, nBytes)
Loop

fs1.Dispose()
fs.Dispose()

Return "Success"

Catch ex As Exception
Return "Failed"

End Try


End Function



End Class
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Kobojunkie: 5:01pm On Dec 19, 2007
Go to www.Asp.net , Sign up and post your code in the appropriate forum, to get answers,
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Nobody: 3:16pm On Dec 20, 2007
You file contains control xters (naturally), so you need to "protect" the data being transferred. Try encoding the file with Base64 encoding, that will allow you to transfer it as a string over regular HTTP. When it gets to the other end, it can then be decoded. I have written a C#/.NET app that retrieves/sends peoples pictures (JPEG files) over a webservice.
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by luckyCO(m): 11:46am On Dec 21, 2007
Please can you help me with some part of the code of all such that I will modify it to suit my need. Thanks
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Kobojunkie: 6:41pm On Dec 30, 2007
Did you ever figure out what the problem was??
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by luckyCO(m): 3:51pm On Jan 07, 2008
I tried my best but I still get the same error response.
Can anybody help me out?
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Kobojunkie: 7:11pm On Jan 08, 2008
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by luckyCO(m): 1:28pm On Jan 19, 2008
Thanks so much I will go through it. I will let you know whether if it solves my problem.

Must I use credentials before calling my web services?
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Kobojunkie: 9:01pm On Jan 19, 2008
Nope
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by luckyCO(m): 1:50pm On Jan 21, 2008
Do u know the funny aspect of it, if I tested the webservices on its own its works but if I refrence it it iwll not.
Still batlling about it, because I need what I will use to transport file from on system to another without sharing the folder.
I will aprreciate any of ur contributions.
I ve gone to the site but dont get much.
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Kobojunkie: 10:37pm On Jan 21, 2008
Reponse, you can't access the client machine to force a file upload due to security restrictions.
The client needs to explicitely select and upload the file.
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by luckyCO(m): 9:48am On Jan 24, 2008
So I can't write a web service that can easily allow my use client machine, pass the filename and it wil go straight to the server?
I think that should be possible that is what compound to my problem.

I need to reference the class from another client to enable me transfer files.

I still believe that this is way out.
Re: I Need A Class Tha Can Transfer Files Using Webservice On Client Machines. Plz U by Kobojunkie: 11:42pm On Jan 25, 2008
Response :

you cant,

You could try an ActiveX installed on the client, or even better would be an exe/service installed on the client.

But without somethign installed on the client you can't force the upload of a client file.

(1) (Reply)

Why Are The Nairaland Programmers Still Using Html 4 Coding...... / I Need A Free Working Vpn App / Need A Private Tutor To Teach Me Word Processing & Programming

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 18
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.