.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

View binary image with Safari in IPad/IPhone

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net
 

Hi All,

Not sure if this issue should be posed here, but i try anyway:

I have a webpage with a button, button click the webpage will write an image (in binary) to the response object, resulting the user can open or save an image.

Code:

            response.ClearHeaders();
            response.ClearContent();

            response.AddHeader("Content-Disposition", "attachment; filename=abc.jpg");
            response.AddHeader("Content-Length", binaryImageFile.Length.ToString());

            response.BinaryWrite(binaryImageFile);
            response.Flush();
            response.Close();


Everything is fine in IE in Windows, but in Safari in IPad/IPhone, it is viewed in a seperate browser tab, with the binary image file written as a very long string.

In Windows, i know you have to select a program to use to open a new file type for the first time, is this the c


View Complete Post


More Related Resource Links

Help ~~ How to Update Binary Image on Formview

  
Hi All ~~ I'm confused, Can i have some help please... Thanks
 
Database: Books
uid dataType uniqueidentifier
Cover dataType image 
 
aspx :
 <asp:FormView ID="FormView1" runat="server" BackColor="LightGoldenrodYellow"   BorderColor="Tan" BorderWidth="1px" CellPadding="2" DataKeyNames="uid"     DataSourceID="SqlDataSource1" ForeColor="Black" Width="525px">
     <EditItemTemplate>
         <table class="table_width">
             <tr>
                 <td class="imageWidth">
                     <asp:Image ID="Image1" runat="server" Height="245px" 
                                       ImageUrl='<%# IIF(Eval("Cover") Is DbNull.Value, "~/Styles/Global/CFZ-No-Images.png", Eval("uid", "~/ImageServices.ashx?BooksID={0}")) %>' Width="180px" />
          

Problem with passing an Image as binary through web service

  

All

I have a web service that is accessed by a windows forms application and receives updates like facility name, address, image etc. Everything works fine except the image data is not being passed to the windows app. I am saving the images in database on both sides, so when I pull it from the server I use the following code

if (!reader.IsDBNull(floorPlanOrdinal))

facility.FloorPlan = (byte[])reader["FloorPlan"];

I can see the facility.FloorPlan Dimentions as 103840 when I debug this method which means that the data is pulled from the database fine.

On the forms side though the dimentions become 0, all other values pass fine except this. Here is the facility property in the web service on server side.

using System;

using System

Background image of Anchor not working with Safari/Firefox

  
Hi, I have following Css where i have used back-ground image. Then i am generating Anchor and assigning css class which has image. It works fine with IE but does not work with Safari,Firefox and Chrome. Can anyone help me on how to fix it. I have given details below. Thanks, Chandan Css .HOME { BACKGROUND-IMAGE: url(../images/home.jpg); WIDTH: 56px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 20px } .HOME A { WIDTH: 56px; HEIGHT: 20px } .HOME A:hover { BACKGROUND-IMAGE: url(../images/home1.jpg); WIDTH: 56px; HEIGHT: 20px } Html Code<td class="home"> <A href="#" class="home" onclick="showpage('abc.html')"/></td>

grid view image delete problem

  
i have a grid in which i am showing a record with image, when user delete the record the image also deleted and when it again enter the record it upload the new image but display the deleted image from the cache example: name.jpeg upload, then deleted, a different file with the name.jpeg upload, it showing the deleted one. 

How to Display Binary Image in RDLC in asp.net?

  
Hi, I want to display Binary image from Database in RDLC. Can some one help me out.   Thanks in advance..  

How Do You Insert An Image From The Image Folder Into A Binary Column?

  
Hello Forum, How would I go about inserting an image that's in my images folder into a sql table column of datatype varbinary(MAX) ?    Thank you

Receive Image From Iphone

  
Hello, i am currently working on a project with an iphone developer in which i need to receive an image to my .net 1.1 web service. Here is the code that locally works fine if i take an image and convert to bytes... but from the iphone it is coming across as an unreadable 1 kb file. Any thought or experience? Is it encoding issue? Developer says he is sending it as utf8? Thanks! <WebMethod()> _    Public Function UploadFile(ByVal fileBytes As Byte()) As BooleanTryDim ms As New MemoryStream(fileBytes)Dim fs As New FileStream("c:\attachments\test.jpg", FileMode.Create)ms.WriteTo(fs) ' clean upms.Close()fs.Close()Catch ex as ExceptionEnd TryEnd Function  

AJAX DragPanelExtender and Safari/iPhone

  
Is DragPanelExtender not working in Safari/iPhone? Same page works just fine in other browsers but not on iPhone. Thanks

finger swipe on ipad/iphone for datapager control

  

hi all,

i am currently develping a webpage for ipad/iphone user, but the problem now i face is adding the finger swipe feature for the datapager control, if the user swipe finger to the left, i want the pager to go previous and swipe right side for the next page.

after i research, i got the code for swiping using javascript,  when swiping different direction, the background of the page will be changed, but i just dont know how to implement the code to my datapager control, please help me, thank you.

 

 

 <script type="text/javascript">
      // TOUCH-EVENTS SINGLE-FINGER SWIPE-SENSING JAVASCRIPT
      // Courtesy of PADILICIOUS.COM and MACOSXAUTOMATION.COM

      // this script can be used with one or more page elements to perform actions based on them being swiped with a single finger

      var triggerElementID = null; // this variable is used to identity the triggering element
      var fingerCount = 0;
      var startX = 0;
      var startY = 0;
      var curX = 0;
      var curY = 0;
      var

Writing image binary data to the Response

  

Hi there,

I've created 2 web user controls. A = User control that displays an image, and B is the user control that hosts A. I'm trying to stream an array of bytes to A, but it seems like the Response.BinaryWrite method completely overwrites any heirachial controls (I can't see any of B's other controls besides the image).

How do I get A to just display the image from the byte stream? It doesn't come from a database, it's an image I created on the fly.

A's code:

        public void UpdateImage(byte[] imgbytes)
        {
            Response.ContentType = "image/jpg";
            Response.BinaryWrite(imgbytes);
            Response.End();
        }


Thanks!



"view state" does't work for Image's ImageURL in dynamic controls

  

Hi all. in my page_load method I call a mthod that it create some dynamic controls. one of them is an Image control that it's ImageURL property set to an URL that is saved in data base. image shows that URL but when postback ocuurs, previous image controls doesn't their image. but other controls for example TextBoxes keep text values. what should I do for keep image url property for this dynamic Images controls?

 


Binary Data Problem....save and retrive image data from sql database

  

hello friends...please help me to solve this problem....

i have created crud (create, retive, update and delete)form and it's running... here i want to add images for each record(sql database)....

i'm using image datatype in sql table for picture.....

Q 1: how to save and retrive binary data(image) from sql table in asp.net form using vb coding?

Q2: can i create sql table which store binary(image url) data direct?

thank you


iPhone Safari and the Viewport Tag

  

I'm putting this tag at the header of my HTML pages, trying to get the page to stop vertical scrolling on mobile browsers like iPhone Safari:
 <meta name="viewport" content="width=device-width, height=device-height" />
 But as shown here, it doesn't work: http://wesspace.net/viewport.aspx
 Note that there is no content to see when scrolling down, so no scrolling is necessary. But if a user pushes the page up with a finger (in other words, scrolling down), a blank area is revealed. This bug only occurs on mobile browsers, except Fennec, which does a great job. So does anyone know how to prevent the user from scrolling down into the void?

I'm putting this tag at the header of my HTML pages, trying to get the page to stop vertical scrolling on mobile browsers like iPhone Safari:

Storing Image in database as image type and viewing it on grid view

  

 how can i store image into database and view it in grid view?



Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend