I want to ask. In general, how to get images through URLs is the way to get images through get

Source: Internet
Author: User
I want to ask. In general, how does one get an image through a url? The company's ios said that he could only encapsulate the image into a data stream, and then pass it through the parameter. then the parameter is too long to pass. I would like to ask, is this my technical problem? it is very hard. I am a fresh graduate. I have never heard of using gey for four years at school. is my experience too short? I mean I can't do anything. if you think I'm here to spray ios, just spray me. By the way, please get me and ask. In general, how does one get an image through a url?
The company's ios said that he could only encapsulate the image into a data stream, and then pass it through the parameter. then the parameter is too long to pass.
I would like to ask, is this my technical problem? it is very hard. I am a fresh graduate.
I have never heard of using gey for four years at school. is my experience too short?

I said I couldn't do anything. if you think I'm here to spray ios, I 'd like to try it out. By the way, I 'd like to find a get solution. thank you.
------ Solution --------------------
I have never heard of it. wait for the ox to get up to 1024 bytes and wait for the ox to solve it.
------ Solution --------------------
I have never performed IOS, but I guess it is not through get.

Reference: php: // input
------ Solution --------------------
Is post okay?
A lot of off-the-shelf code on the Internet

Class image {
Const ROOT_PATH = './';
Const FAIL_WRITE_DATA = 'fail to write data ';
// No data flow
Const NO_STREAM_DATA = 'The post data is empty ';
// The image type is incorrect.
Const NOT_CORRECT_TYPE = 'not a correct image type ';
// The file cannot be created.
Const CAN_NOT_CREATE_FILE = 'can not create file ';
// Upload the image name
Public $ image_name;
// Save the image name
Public $ save_name;
// Image storage path
Public $ save_dir;
// Directory + complete Image path
Public $ save_fullpath;

/**
* Constructor
* @ Param String $ save_name save the image name
* @ Param String $ save_dir save path name
*/
Public function _ construct ($ save_name, $ save_dir ){
// Set_error_handler ($ this-> error_handler ());

// Set the name of the saved Image. If this parameter is not set, a unique file name is randomly generated.
$ This-> save_name = $ save_name? $ Save_name: md5 (mt_rand (), uniqid ());
// Set the path for saving the image. if not set, the directory is stored in the year/month/day format.
$ This-> save_dir = $ save_dir? Self: ROOT_PATH. $ save_dir: self: ROOT_PATH. date ('Y/m/D ');

// Create a folder
@ $ This-> create_dir ($ this-> save_dir );
// Set the Directory + complete Image path
$ This-> save_fullpath = $ this-> save_dir. '/'. $ this-> save_name;
}
// Compatible with PHP4
Public function image ($ save_name ){
$ This->__ construct ($ save_name );
}

Public function stream2Image ($ data ){
// Binary data stream
// $ Data = file_get_contents ('php: // input ')? File_get_contents ('php: // input'): gzuncompress ($ GLOBALS ['http _ RAW_POST_DATA ']);
// Save the data stream if it is not empty
If (! Empty ($ data )){
// Create and write data streams, and save the file
If (@ $ fp = fopen ($ this-> save_fullpath, 'W + ')){
Fwrite ($ fp, $ data );
Fclose ($ fp );
$ Baseurl = "http ://". $ _ SERVER ["SERVER_NAME"]. ":". $ _ SERVER ["SERVER_PORT"]. dirname ($ _ SERVER ["SCRIPT_NAME"]). '/'. $ this-> save_name;
If ($ this-> getimageInfo ($ baseurl )){
Echo $ baseurl;
} Else {

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.