简体   繁体   中英

Upload image to the server without file upload control

Am currenty working on writing code in c# to handle some operation for our iphone app.These code files will be in our server and the url are used by iPhone team to call those specific files and ger their values.

Now am working on photo upload functionality.I have no idea how to proceed.In asp.net i used fileupload control and saved photos in our server using fileupload control's saveas property.How can i Upload photos to the server without using any such control,i ll be having only path of the image . Can anyone suggest any other way to upload image to server without using any controls

EDIT:

Ths is not a asp.net app for iphone. Instead of writing codes in X code we write the code in asp.net & c#.They can call these url and pass values to it through querystring and get the results.

For example:

There will be a page called get userid .the Iphone phone team can pass the username through querystring and get the userid eg.(www.xx.com/MgetUserId?uname=yyy prints the username onto the aspx page which they will use )

Does your iPhone team need to programmatically upload files? If so, I would suggest you write a web service that they can call to upload the files without user interaction. The simplest method you could implement is a webservice that accepts a byte array.

If you go down this route, make sure you think about security around the web service, so only your approved applications can upload a file.

You may use html input tag and jQuery plug-ins ( uploadify ).

<input type="file"/>

If you want to download a file/data from know location then you may use WebClient class methods.

you need to use c# webclient uploadfile method

read here for explanation http://msdn.microsoft.com/en-us/library/36s52zhs.aspx

You can't use any HTML controls to upload files for the iPhone while using their default Safari browser. YOu can download another browser for the iPhone that does this but I assume that isn't going to help you.

Essentially after all my searching on the problem you need your own app on an iPhone to upload files. The iPhone has no way to upload data from the browser. They just don't allow it, where almost every other smartphone does.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM