|
Sorry, you are right these permissions are machine specific...
Then Response.BinaryWrite(Byte[]);
Response.End()
Will give a popup which will allow user to save file...
|
|
|
|
|
hi sir ,actually i am having a abc.tif in the server.when clinet click a down load button this file has to download ..and when client again click sava then a save as pop diolog has to come to specify where to save this server file in the clinet machine ..will u give excat code...
|
|
|
|
|
Try something like this...
<br />
string sourceFile = "abc.tif";
<br />
<br />
FileInputStream filIpStrm = null;<br />
MemoryStream ms = new MemoryStream();<br />
filIpStrm = new FileInputStream(sourceFile);<br />
sbyte[] buffer = new sbyte[1024];<br />
int len = 0;<br />
while ((len = filIpStrm.read(buffer)) >= 0)<br />
{<br />
byte[] bbuffer = new byte[1024];<br />
System.Buffer.BlockCopy(buffer,0,bbuffer,0,1024);<br />
<br />
ms.Write(bbuffer,0,1024);<br />
}<br />
Response.OutputStream.Write(ms.ToArray(), 0, Convert.ToInt32(ms.Length));<br />
<br />
filIpStrm.close(); <br />
Response.ClearContent();<br />
Response.ClearHeaders();<br />
Response.ContentType = "application/octet-stream";<br />
Response.AppendHeader("Content-Disposition", "attachment; filename=AAA.tif");<br />
Response.Flush();<br />
Just check how can you access the file like I have written directly Source file name, just check how can you get your file in byte[]....
|
|
|
|
|
sir where i have to attach this code sir
|
|
|
|
|
You must be allowing user to save the file on some button click or something so you ll have to write the code in that event..
|
|
|
|
|
Response.AppendHeader("Content-Disposition", "attachment; filename=AAA.tif");
may i know wat for this one and can i get a save as popup dialog box
|
|
|
|
|
This is the part of code which is allowing a pop up to appear and open file as an attachment if you wont do so the file will get open in same window... filename u can give wotever you want..
I never tried for SaveAs button so sorry no idea... You can google it out but by the way Save button will also provide same functionality, It will allow user to select desired location to store the file..
|
|
|
|
|
If you want Open,Save and Close button I guess you need to Response.End() instead of Response.Flush() just check it and update if required....
|
|
|
|
|
Error 2 The type or namespace name 'FileInputStream' could not be found (are you missing a using directive or an assembly reference?) D:\jagadeesh\serverdownload\Default.aspx.cs 30 25 http://localhost/kumars/serverdownload/
sir
i copied the code wich u sent but iam getting the error like this Fileinputstrem and i wrote using system.io also anything ohter i have to specify
|
|
|
|
|
ohhh I forgot to tell u its a java.io stream Add vjslib and vjscor in references and then add namespace java.io
|
|
|
|
|
sir thanks its getting the save file diolog box ...sir now want the dowloaded path in a variable
|
|
|
|
|
jagadeeshkumar2106 wrote: how i can down load a file from server to a client machine
Redirect to that file which will open a file save dialog by browser. Response.Redirect("YourFile");
|
|
|
|
|
hi sir how r u ..iam little bit confusion with ur answer this is actual requirement...sir
actually i am having a abc.tif in the server.when clinet click a down load button this file has to download ..and when client again click save then a save as pop diolog has to come to specify where to save this server file in the clinet machine ..will u give excat code...for me sir
|
|
|
|
|
jagadeeshkumar2106 wrote: i am having a abc.tif in the server.when clinet click a down load button this file has to download
Inside the button click event, write Response.Redirect("abc.tif") to start the downloading.
jagadeeshkumar2106 wrote: and when client again click save then a save as pop diolog has to come to specify where to save this server file in the clinet machine
Once you did a redirect to the file, browser will check for the extension and trying to match a application which can open that file. It shows you a popup window with save and open buttons. Clicking on save, user will be asked for the location for the file to get saved.
You don't need to worry on this, browser will take care
|
|
|
|
|
Response.Redirect("http://localhost/kumars/serverdownload/abcfile/createuser.tif");
hi sir the same code i wrote in the button click but its getting opened the content in that file but the pop window of save and open is not comming ...plz see this once
|
|
|
|
|
May be the extension TIF has been mapped to the application and browser opens it. Which is the browser you are using ? Firefox ?
|
|
|
|
|
iam using internet explorer sir
|
|
|
|
|
Plse can u tell me how to display videos in Asp.net 2.0. I used following codes.
<object
classid="clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95">
<param name="FileName" value="video.dat" />
It is working in local host. But after uploading it is not working. I have also changed the class id to
clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6
But still it didn't worked.
|
|
|
|
|
garga1 wrote: Plse can u tell me how to display videos in Asp.net 2.0. I used following codes.
ASP.NET has nothing to do on displaying video. You can try some HTML tags which helps for this. Do you mind to do a search[^] before you post it over here ?
|
|
|
|
|
hi
i have a aaplication in which i have store the dataa in hindi and and when i write in textbox in hindi it will appear in hindi but store in database in english can anyone help me how i overcome with this problem
the code is:
<asp:TextBox ID="TextBox1" runat="server" meta:resourcekey="TextBox1Resource1" Style="z-index: 102;
left: 370px; position: absolute; top: 89px;font-family:Kruti Dev 010;" ></asp:TextBox>
thanks in advance
|
|
|
|
|
Ravi_21 wrote: database in english
Which is the data type you are using ? Try using nvarchar which can store utf encoded characters.
|
|
|
|
|
i m using nvarchar but the problem is when i type in textbox it appear in hindi but store it in english
<asp:TextBox ID="TextBox2" runat="server" Style="z-index: 103;
left: 364px; position: absolute; top: 40px; font-family:Kruti Dev 010; font-weight:bold;"></asp:TextBox>
|
|
|
|
|
What Happens When u fetch data from database is it in form of hindi or english?
i think it will be stored in database in only english, but while getting data from it it should display in hindi
Believe Yourself :->
|
|
|
|
|
no it will appear in english please help me its urgent
|
|
|
|
|
Ravi_21 wrote: please help me its urgent
Don't think so. You are being rude demanding people help you right away.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|