C# - Refer The Resultant Xml File Which Is Being Constructed And Saved From Webservice File

Sep 6, 2010

This is my webservice code which performs constructs xml file and stores to particular destination ,Is this the correct way to store the resultant xml file ,or let me know if their are any alternate procedure to do so.

[WebService(Namespace = "[URL]")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class JsonWebService : System.Web.Services.WebService
{
XmlDocument xmlDoc = new XmlDocument();
public string keyword;
public JsonWebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public bool GetList(string keyword1, string streetname, string lat, string lng, string radius)
{
XmlDocument xmlDoc= CreateXML( keyword1,streetname,lat,lng,radius);
//save file to application folder which will be refferd by client application
xmlDoc.Save(@"C:Documents and SettingsDesktop lockBlock3.xml");
return true;
}

I am not able to refer that xml file constructed at webservice ,from clientside applicaton this will be my code on clientside ,is this the right way to refer saved xml file

function searchLocationsNear() {var searchUrl ="[URL]"; //reference for xml file stored in application folder
GDownloadUrl(searchUrl, function(data) {
var xml = GXml.parse(data);
var markers = xml.documentElement.getElementsByTagName('marker');
map.clearOverlays();
..........................

View 1 Replies


Similar Messages:

Fileupload Using Input File / Refer To 'AsyncPostbackTrigger' Or 'SyncPostBackTrigger'?

Aug 10, 2010

I am using VS-2005.

In my website I have used the html input control with type=file.

The problem is that when I place this control inside an 'UpdatePanel' the 'PostedFile' property becomes 'Nothing' on postback. So in order to get things working I have removed the 'UpdatePanel' and things are working fine.

However, I am interested to know what kind of workaround is required if I were to use an 'UpdatePanel'? In one of the threads at forums.asp.net I found that we need to set a 'PostBackHandler' for the update panel. I have no idea how to implement this. Does it refer to 'AsyncPostbackTrigger' or 'SyncPostBackTrigger'?

Can someone give an idea how to implement this?

View 1 Replies

Save Local File Path As String And Open File From Saved String?

Jan 29, 2011

I have a form where users can store some data for archived documents. All documents are ONLY in PDF format.

There are 2 things I would like to do:

1. there is a "file path" text box on the form. I would like to open a "browse file dialog" box when user clicks the textbox and then the user browses for the file (file is on the users local machine) and selects it. The full file path should be saved to the textbox as string (e.g. "c:archive2010document11122011.pdf"). Also I would like to "limit" the file browser dialog to only show PDF format files...

2. add a code behind command to open the file from the saved path+name (see 1.) in the user's default PDF viewer (Acrobat or Foxit)

View 11 Replies

Web Forms :: Getting Name Of Saved File?

May 10, 2010

When saving a file using vb.net:

file.SaveAs("c:/xx/xx/xx/xx/xx/" & file.FileName)

If a file is saved that already exists, is there a way to capture the saved filename?

View 1 Replies

Edit Saved PDF File In Webpage?

May 26, 2010

i let the user to edit and save the pdf file How to do this is there any api from adobe for controlling pdf file in asp.net web page can i have some sample codes

View 4 Replies

How To Read A Text File And Saved In Database

Nov 13, 2010

How to read a text file and saved in data base

View 1 Replies

C# - Getting The New Filename Of A File Saved With Ajax AsyncFileUpload?

Dec 16, 2010

I'm saving a file with the asyncfileupload ajax plugin from the ajax toolkit and when I save it I'm changing the filename (to avoid multiple files with the same name).

After the file is uploaded, the user needs to know what the file has been named so I'm using this javascript code on the onclientuploadcomplete event.

function UploadComplete(sender, args) {
alert(args.get_fileName());
}

This works except it gets the old name, not the new name (which is determined server-side). Is there any way to get it to return the new name rather than the old name? Or any work around to achieve this?

This is my code in the code behind the get the new filename:

string filename = DateTime.Now.ToString("dMyHmsf") + e.filename;
string strPath = MapPath("~/SavedImages/") + filename;
AsyncFileUpload1.SaveAs(strPath);

View 1 Replies

Unable To Get The Content Of The Text File Saved In The Database(My-Sql)

Apr 4, 2011

In my MySql i am having my data field as longblob i would like to get the content in that file so i have written my code as follows

This is what i am doing before inserting

string filePath = Server.MapPath("AchTemplates/genACH.txt");
string filename = Path.GetFileName(filePath);
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader br = new BinaryReader(fs);
Byte[] bytes = br.ReadBytes((Int32)fs.Length);
br.Close();
fs.Close();
string strQuery = "insert into tblFiles(FName,FData) values (@_FName, @_FData)";
MySqlCommand cmd = new MySqlCommand(strQuery);
cmd.Parameters.Add("@_FName", MySqlDbType.VarChar).Value = filename;
cmd.Parameters.Add("@_FData", MySqlDbType.LongBlob).Value = bytes;
InsertUpdateData(cmd);
//Get Data
private void download(DataTable dt)
{
Byte[] bytes = (Byte[])dt.Rows[0]["FData"];
Response.Buffer = true;
Response.Charset = "";
Response.Cache.SetCacheability(HttpCacheability.NoCache);
Response.ContentType = dt.Rows[0]["ContentType"].ToString();
Response.AddHeader("content-disposition", "attachment;filename="
+ dt.Rows[0]["Name"].ToString());
Response.BinaryWrite(bytes);
Response.Flush();
Response.End();
}

But i am getting the content as system.string[].

View 1 Replies

Web Forms :: FileUpload - File Not Getting Saved In Folder Location

Aug 7, 2013

My File is not getting saved in the folder location

"C:Documents and SettingsSweet PcDesktopWebSite12uploadResume"

My code

uploadResume.SaveAs(Server.MapPath("uploadResume" + uploadResume.FileName));

View 1 Replies

Web Forms :: File Size Saved On Local System Is Not Same As The Server?

Mar 6, 2010

i have file

Response.Clear()
Response.ContentType =
"application/octet-stream"
Response.AddHeader(Response.WriteFile(M_FILENAMe, "Content-Disposition", _"attachment; filename=""" & M_FILENAMe & """")True)Response.Flush()
Response.End()

the file is being saved on the server & needs to be same on the local system too so used the above code but the actual size is nt being saved on the local system if the file size on server is 3 MB in local system i gets saved in kbs

View 3 Replies

Data Controls :: Delete File Saved In Database Using GridView

Feb 26, 2014

When I am creating a new form, I am inserting "RequestId" of particular form in Textbox as well as uploading multiple file (that comes in Gridview)and on save button click, those gridview multiple files with "RequestId" are saved in Database as below:

Id Request Id File Name

1 12 Abc.jpg
2 12 Xyz.doc
3 12 Pqr.png
4 11 Abc.xls
5 11 aa.jpg

NOTE: Auto increment of "Id" is true.

Now, I want that If I delete any file from the Gridview(which has all uploaded files), I want that file to be deleted from database table also.Currently on Deleting file from Gridview, files from "Folder" are deleted not from Database.

View 1 Replies

Data Controls :: How To Modify File Saved In Database Using GridView Control

Jan 12, 2014

Based on the the following article:

Upload and Download files from SQL Server Database in ASP.Net

View 1 Replies

Forms Data Controls :: Downloading An Excel File Saved On The Same Server As Website?

Oct 21, 2010

I able to successfully see all the Excel files in the given folder using the datagrid and code below. Now I would like to be able to click the link to the file, or add a button, to get a download file dialog box.
[Code]....

CodeBehind:

[Code]....

View 2 Replies

Forms Data Controls :: Click Gridview Hyperlink To Download File That Is Saved In Share Folder?

Dec 1, 2010

I have a gridview with hyperlink button in every row. Gridview is bind with some datasource.

Just what i want to do that when user click on hyperlink on particular row hyperlink button it should download a file.

The files are going to be saved daily in a share folder.

Secondly, I don't want to give user an option to open that file, means when user clicks hyperlink a dialog box should appear with open button.

how to find particular file as per date from share folder and download.

View 40 Replies

C# - Send File Via Webservice?

Aug 17, 2010

how can i send a file via web service in my site. same as gmail attachments in c# and asp.net

View 2 Replies

C# Webservice Returning Docx File?

Nov 8, 2010

I have some xml data. I've made an asp.net soap based webservice that takes the xml as a byte buffer applies xsl transformation to it and converts it to a docx file. But when i return the docx file using the response object i get an error that client found response of type application/vnd-word but it was expecting text/xml.

Service Snippet to push document file after xsl transformation

Context.Response.Clear();
Context.Response.ClearHeaders();
Context.Response.ContentType = "application/vnd.openxmlformats- officedocument.wordprocessingml.document";
Context.Response.AddHeader("Content-Disposition", "attachment; filename=" + "test.docx");
Context.Response.Flush();
Context.Response.End();

View 3 Replies

WCF / ASMX :: WebService Returning Pdf File?

Jul 8, 2010

I am using C# 2.0. I am trying to create a webservice that returns a pdf file.

I tried this:

[Code]....

Is this the correct way? I am not getting any errors, but want to know, if this is correct.

View 6 Replies

C# - Download File From Webservice - In ASP.NET Site

Feb 10, 2010

I want to push a file to the browser from a website using a webservice. I'm currently reading the file into a base64 byte array, and returning that from the webservice. This webservice is called from a website, and i'm stuck on how to push this as the original file to the browser. Ideally I would like to read the byte array into a memory stream, and then just write it to the Response stream if possible so the end user just downloads the file.

View 4 Replies

Web Forms :: Finding The Required Text From The Saved Text File

Jun 25, 2010

i have saved a text file with a name batchheader.txt.

View 3 Replies

WCF / ASMX :: File Management Between Webservice And Website

Aug 8, 2010

I have a Webservice that receives a file (byteArray) and saves it on server disk.

[Code]....

But my webservice isn't hosted on the same folder of my website.

I mean: [URL] Is it possible to put a webservice on the same folder of the main website? Or it's not a problem ? (Can I retrieve the files in the webservice's folder from website?)

View 1 Replies

Steps Involved In Reading An Xml File From Webservice?

Mar 19, 2011

I would like to know what are the basic steps involved in setting up your application to able to read data from another application. Then take that data and modify it and send it back to the application.
The data being read will have over 100 fields.... what is the most efficent way to store them? Put them in a class object?

I know web services are involved..

The application is in .NET using vb

View 1 Replies

WCF / ASMX :: How To Set WebService NameSpace In Web.config File

Aug 27, 2010

I am trying to put the namespace value as a key in web.config file, so that when I deploy this on production, I just have to change the namespace key in the config file only, not on all of my webservice cs files. But When I try to browse this webservice after changing this code I get compilation error.

web.config:

[Code]....

MyWebService.cs (this code works)

[Code]....

Compiler Error Message: CS0182: An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type

View 1 Replies

WCF / ASMX :: Write Html File Through Webservice?

Sep 12, 2010

I am writing an application in which I want to generate dynamic html file based on the parameters of jquery objects. I want to pass the parameters to a webservice which will produce the required html page. How I can achieve it.

View 5 Replies

WCF / ASMX :: Fill A String From A File In A Webservice?

Nov 11, 2010

I have a path to a file, say "~xsdFile.xsd".The content of this file I want to set into a string.

I use the following code:

[Code]....

The problem I get if I use this webservice twice in 10 seconds I get the following error: "Cannot acces files because another process is using it".

View 2 Replies

Cannot Upload A File To A Webservice And Get The Response In Json Format

Aug 10, 2010

I have a simple webservice that I would like to upload a file to. The problem is that I need the response in json.

Form my experience in order to get a response in Json my request has to have a content-type of 'application/json'. But ofcourse this cannot be the case with a file upload since the content type will have to be 'multipart/form-data'.

In my Json i want to return a value showing whether successful and a filename.

[code]...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved