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?
<WebMethod()> _
Public Function UploadFile(ByVal fileBytes As Byte()) As Boolean
Try
Dim ms As New MemoryStream(fileBytes)
Dim fs As New FileStream("c:attachments est.jpg", FileMode.Create)
ms.WriteTo(fs)
clean up
ms.Close()
fs.Close()
Catch ex as Exception
End Try
End Function
I have a requirement to design an ASPX page to receive a binary image from a remote call. Basically, our client wants to send a POST request from their server to this particular page. This POST request contains some parameters, as well as an JPG image. How should I design this ASPX page to receive all these information? I need to convert the JPG image to byte[] array and save it to DB, together with the rest of the parameter values.
I am currently developing an iPhone app that will work as a security check-in system for events at a church. The main goal is to be able to search a pre existing MS SQL database for a participant, and then save them to a list on the iPhone/iPod Touch/iPad. Easy enough. One of the fields in the MS SQL database is of Image data type, and its function is to store the participant's image in binary form. I currently am not allowed to switch to varbinary(MAX). From the iPhone, I use:
You may be wondering what the base64StringFromData is. It's a category discussed here, Any base64 library on iphone-sdk? In the category, it returns a string as NSASCIIStringEncoding. I then send that string to a Visual Basic web service using POST. Assume in the following that I have already set up and opened my SQL connection, and initlialized a SQL Data adapter and command. So the function looks similar to this:
Public Function sendCommand(ByVal image As String) As String Dim commandString As String commandString = "insert into phoneApp(image) values(@image)" Dim encoding As New System.Text.UTF8Encoding sqlDataAdapter.InsertCommand = (commandString, sqlConnection) sqlDataAdapter.InsertCommand.Parameters.Add(@"image", SqlDbType.Image, image.length).Value = encoding.GetBytes(image) sqlDataAdapter.ExecuteNonQuery() End Function
Now, finally, here's what is happening. In another function, I call Response.BinaryWrite(SqlDataReader.Item("image")). In Internet Explorer, doing this would then make the image appear in the browser. Instead, it displays the string in base64 form. Copy and pasting that string in a base64 converter off the net, and it works. So the encoding on the iPhone did encode to base64 properly. Here's the question. Do I even need to be encoding to base64 to save into Image Data Type, or should I be focusing on learning how to encode the NSData into a different binary string?
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.
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 case in IPad? that i need to select a program?
I have a service which reads an image stored in the database. I want to be able to read an image stored on the file system and return that back to the requestor.
I have developed simple user registeration application form in that after press submit button i am sending mail to user for welcome template as well as i am also get on mail for user details like name email id, and ip address.my problem is the user can receive the mail form my site but i am receive the any user details mail it doesnot shows any exception what is the problem i donno please
Users can edit images downloaded from my site and then upload them back using a WCF Web Service. The problem is when users go to view images, they often do not see the latest versions because of caching. I'd rather not turn off the cache because it substantially reduces bandwidth. Is there a way to have the Web Service perform some action upon an upload to notify the next web client call that the image has changed?
In asp.net (or vb) I must to call a page that only autenticates a user, returning the user data if the logon succed. This way, I would like to implement the sequence:
A blank page (mine) request the autenticator page (3rd part) automatically on load; The user logs in the autenticator page; My page reads the autenticator page results and do the actions.
I'm a very begginer in asp.net, and I'm using vb.net in the environment for coding the page "onload" event. I'm trying to use the "redirect('url')" method to call the autenticator's page, but in this way, obviously, I can't receive the result. How can I implement this sequence?
I wanted to send and receive SMS from my application, as of the need i bought a Wavecom GSM Modem. I also downloaded ActiveXperts Toolkit for communicating with GSM Modem, i can be able to send SMS through the GSM Modem. have problem with receiving SMS.
I have my iPhone app that calls an ASP.NET Webservice to download "data". Most of this needs to be protected, but currently the webservice that's deployed can be called by anyone who can figure out its URL, thus resulting in a complete loss of security.
The simplest form that I can think of would be for the phone to make a call over HTTPS including the username, password that the user logs in with, with every web service all. And each method will check to see if these credentials are correct before sending data to the user.
But this will result in an additional database call for every request to check if the user is authenticated, which is not very efficient.
I'm completely blanking here. I've got 2 servers that cannot talk to each other via normal network traffic (like just copying a file). I can't get FTP setup on either server due to artificial company security constraints.Server1 basically just has an exe on it that I have written, and it needs to send a file to Server2.Server2 has a full blown asp.net website on it so I'm writing a .ashx page to handle receiving the file.So...Server1 needs to make a call to server2 and send a file to it over http. Server2 needs to accept the file and save it to disk.Where should I start? I know I can make server1 create a WebRequest object, and set the methodto POST, and then stream the content.But on server2, what am I supposed to write? A generic handler? Will my file that I send be part of the context.Request object? How do I get it out?
I am create an iPhone app that needs to talk to a Windows C# app. The app will run as either a Service or Form Application.
What would be the best way to accomplish this? Ideally exposing a service-type architecture would be best as I don't need a stateful connection (stateless is fine in this case).
Can a WCF service hosted by my app using a form of TCP binding be consumed by my iPhone? Or can an app host using httpBinding without the aid of IIS or some other web server?
I have a asp.net website and I am accessing that web service from my iPhone app to get data. The WCF web service produces data as JSON.I want to put some kind of authentication on the WCF. What you you guys recommend?
Web developer newbie question (I am otherwise fluent in C#!):
I need to set up a web site (ASP.NET/C#) that can receive XML posts via HTTP. I haven't the first clue of where to start. Create web site? Web page? Web service? WCF? Can you self-host it, or must it be on IIS? How/where do you catch the post event?