473,394 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Posting files to services in C#

Hi,

Is there a way in C# to post a file to a web service without using the File Browser control. The actual requirement is my application is generating an XML file and I need to post that XML file to a web service as a parameter. Please note I need to post the actual file not the content or path of the file. Is there any way to do this in C#?

Thanks a lot in Advance!

Ravi Jindal
Oct 2 '08 #1
2 1142
PRR
750 Expert 512MB
Hi,

Is there a way in C# to post a file to a web service without using the File Browser control. The actual requirement is my application is generating an XML file and I need to post that XML file to a web service as a parameter. Please note I need to post the actual file not the content or path of the file. Is there any way to do this in C#?

Thanks a lot in Advance!

Ravi Jindal
what do you mean by "not the content or path"? webservice method can have parameters like string or XMLDocument as input for xml strings...
The same method can then recreate the file at the server end....by writing to disk..
Oct 2 '08 #2
Curtis Rutland
3,256 Expert 2GB
So, you need to transfer a file across a web service, is that right?

Well, you can make a [WebMethod] that takes a byte[] as a parameter. Then, on your program side, use a FileStream to read into a byte[]. Pass the byte[] to the service. On the service side, use another FileStream to write the buffer to disk.
Oct 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ya Ya | last post by:
I have a folder with a lot of PDF and CHM files. I would like to develope an ASP.net application that enables the user to search inside the content of those files. How do I search inside those...
0
by: Don | last post by:
I intermittently get a runtime Compilation Error that says 'The compiler failed with error code 2000'. It appears that a DLL cannot be found in the 'temporary asp.net files' directory. The...
2
by: Vinu | last post by:
Hi, I am facing one problem related to global variables in .so file. When ever I access the variable the application is crashing I have a class called services. class services { services(){...
1
by: bruce.1 | last post by:
I'm trying to figure a way for a remote user -- using ASP.NET -- to share files on a local office LAN. The remote user would go to an ASP.NET website (on the LAN), mark the files they want, and...
10
by: dermot | last post by:
I have wrriten a small windows service application in visual studio ..net 2003 which listens for incoming FTP files. These files would overwrite over time due to duplicate file names. However any...
6
by: David++ | last post by:
Hi folks, So I have implemented a Web service which provides several Web Methods. Before the client can use the WebMethods they must first be authenticated and authorized i.e. they login, obtain...
1
by: herbert | last post by:
In VS.2005 a Windows Service can have an app.config file. A class library can also have an app.config file. Now if my Windows Services uses three class libraries, each of it coming with its own...
4
by: Peter Afonin | last post by:
Hello, I have a form with several buttons, and I need to post this data to several different applications. In ASP.NET 1.1 it was quite easy - I just used HTML controls (text or hidden), then...
10
by: sandipm | last post by:
Hi, In my application, I have some configurable information which is used by different processes. currently I have stored configration in a conf.py file as name=value pairs, and I am importing...
2
by: nja2222 | last post by:
I would like to create a page for my clients to login and check for updates on their accounts. Then I would like to create a page where my employees can login and make updates, specifically new file...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.