Wechat development, photo uploadRegarding the photo upload in WeChat development, the following are some related processes and precautions:
** 1. Basic photo-taking process **
1. ** Before taking photos **: Show the cancel and take photos buttons.
2. ** After taking a picture **: Show the previews and the buttons to retake, cancel, take a picture, and upload.
- He clicked on the retake button, and the previews were replaced by the photo interface.
- He clicked on upload and uploaded the pictures for the previews.
- He clicked cancel and returned to the previous interface.
** 2. Development environment related (if it involves the development of webpages or Mini programs and other related photo uploading functions)**
1. ** In terms of technical support **
- If the development of the Mini programs involved functions such as photo uploading, it was developed based on the HMTL5 technology, and the Mini programs server provided services for data storage, transmission, and processing, which was the core part of the Mini programs. At the same time, the WeChat Android was the technical interface provided by the official WeChat to the developers, which helped the developers better use the Mini programs on WeChat and provided a rich functional interface to quickly build the Mini programs.
- In the development environment, such as vue.js, native h5 input file, Weixin Official Accounts webpage:
- In terms of installation, if there was a problem with the direction of the photo taken under the IOS-OS, exif-js was needed to read the photo information and rotate it;axios was used to request support in an synchronous manner;vuex was mainly used to store progress information and execute the "npm install exif-js--save" command.
2. ** Code-related (the code logic of the photo-uploading function in the example)**
- In photoHandle.js, there is a related method:
- There was an image upload method called "uploadImg", which accepted an input node "dom" to get the image and a configuration object "config". In this method, the image would be analyzed, such as obtaining the node through "document. queryListener (dom)", obtaining the file "file = $c.files(0)", constructing the FormData object "param = new FormData()", and using the operations such as "reader = new FormReader ()" to prepare for subsequent image processing. The following methods included compressing the image "imageCompress" method, converting the compressed base64 string into a blob file stream object "dataURItoBlob" method, and aja upload "upload" method.
3. ** Problems and solutions that may be encountered (parts related to photo upload, such as photo orientation problems)**
- During the development process, if it involves taking photos under the OS, there may be problems with the direction of the photo. You can use exif-js to read the photo information and rotate it.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Intermediary card, photo uploadIf the intermediary took photos and uploaded relevant information when applying for the card, there was a certain risk. Some unscrupulous agents might cheat information and collect all personal information, including identity information, work, education, family, relatives and friends, etc., for sale. If the intermediary claimed to help apply for a credit card and asked for card information (such as the expiration date, the last three security verification codes on the back, the transaction password, etc.), they might use this information to transfer funds online. There were also unscrupulous agents who asked for scanned ID cards or remote Face Recognition, original savings cards, etc. in the name of card application. It might be to swindle the savings card and then sell it or carry out illegal activities such as money laundering.
However, when a formal intermediary handles business, they will protect the customer's information security according to the prescribed procedures and bear certain legal responsibilities. However, when selecting an intermediary, they still need to carefully evaluate their reputation and service level, clearly inform the other party of the purpose and scope of information use and ensure information security.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Can I upload a photo to my story?Sure! Usually, in many social media apps or websites, there's an option to upload photos to your story. Just look for the 'upload' or 'add photo' button.
How can I upload a photo to a story?The process can vary depending on the platform. But generally, you need to find the specific upload feature for the story. It might be in a menu, or maybe there's a plus sign to indicate adding something. Once you click that, browse your files to select the photo you want to upload.
How can I upload a photo on Story?It's usually quite simple. Just look for the upload icon or option within the Story feature and follow the prompts.
2 answers
2024-10-13 22:41
How to upload a mobile phone photo to the TVThere are several ways to upload photos to the TV:
1. Use Wi-Fi to connect your phone and TV. Open the Wi-Fi settings on the phone, find the connected Wi-Fi network, select the corresponding network on the TV, and then download and install the corresponding application on the phone to realize the photo transfer.
2. He connected the phone to the TV with an HD cable. Plugging in the Bluetooth cable to the corresponding ports of the phone and TV, then opening the corresponding application on the phone, you can transfer the photos.
3. Use the cloud storage service to upload the photos to the cloud and access and view them on the TV.
4. If it was a Xiaomi TV, first make sure that it and the phone are connected to the same Wi-Fi network in the local area network. Then, in the app store of the Xiaomi TV,(Mi Store) to search for and download an application called "shared album". After opening the application, a QR code or device name will be displayed, indicating that it is waiting for a connection; Then, he opened the "photo album" application on his phone and made sure that the phone and TV were on the same Wi-Fi network. He navigated to the photo or video option, selected the file he wanted to upload, and clicked the share icon. The phone would automatically search for devices in the local area network. After finding the Xiaomi TV and clicking its name, the phone would generate a connection code. After confirming that the connection code displayed on the TV matched it, he could choose the file type and folder to upload to the TV and start transferring.
5. Prepare a USB data cable, plug the USB plug into the USB port of the TV, and plug the other end into the charging port of the mobile phone; start the TV; press the "signal source" button; find the USB mode in the signal source menu, select it, and press the confirm button to enter the file storage interface of the mobile phone; after entering the file storage interface of the mobile phone, find the folder where the picture file is stored, open the folder, find the picture file, and press the confirm button to start playing.
6. For a TV that can be plugged into a USB flash drive, you can put the photos in the phone in the USB flash drive first, plug it into the TV, and select the USB function to view them. If the TV is a smart TV, the phone can download a "Multi-screen interaction" software. As long as the phone and the TV are in the same Wifi environment, you can watch it through this software. If the TV is connected to a box and the box is in the same Wifi environment as the phone, you can cast it on the TV through the box.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Weixin Mini Programs photo upload functionBased on context alone
The photo upload function of the Weixin Mini Programs has the following features and implementation methods:
** 1. Function and Specialties **
1. ** Ease **
- It provided users with a way to quickly obtain photos and upload them directly in the Mini programs environment without switching to the phone's native camera application and then back to operate. For example, in some ID photo-making Mini programs, users could take photos directly and upload them for subsequent operations such as cutting, beautification, and size adjustment.
2. ** Device compatibility **
- It was very suitable for all types of mobile devices, whether it was an Android phone or an Apple phone, it could normally call the camera to take photos and upload them.
3. ** Authority Management **
- Before using the photo upload function, Mini programs would ask the user to grant the camera and storage (to save the photos taken for upload) permission. The user can choose to allow or reject it according to their needs.
** 2. Realization Method **
1. ** Code Development **
- In the front end development of the Mini programs, it was mainly implemented using the application programming interface (api) of the Weixin Mini Programs. For example, you can use the relevant APIs such as `wx.chooseMedia` or `wx. createCameraContext'.
- Take `wx.chooseMedia` as an example. The developer can set `sourceType` to `['camera']` to specify that only photos can be obtained from the camera, and then set `count` to limit the maximum number of photos that the user can choose (if you only want the user to upload one photo, you can set it to 1).
- After obtaining the temporary path of the photo, he could upload the photo to the server through the network request. This usually involved interacting with the back-end server, which could use various programming languages (such as Python's Flask, Django framework, and the Spring framework of Java) to receive and process the uploaded photos.
2. ** Security and Data Processing **
- During the upload process, in order to ensure the security of the data, the photos were usually encrypted. At the same time, the server would also check the validity of the received photos, such as checking whether the file format meets the requirements (common format such as JPEG, PNG, etc.) to prevent malicious files from being uploaded.
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>
Take a photo and upload it to Weixin Official Accounts and view it.To upload photos and previews in the Weixin Official Accounts, you can refer to the following steps:
1. First of all, he had to do the operations related to WeChat authentication:
- Add the js file in the Index. htl: <strong></strong>
- Inject the permission verification configuration through the configuration interface. The code example is wx. configuration ({bug: true, appId: '', username:, nonceStr: '', signature: '', jsApiList: () }). Here, bug starts the debugging mode, appId is the required unique identification of the enterprise number, username is the required time stamp for generating the signature, nonceStr is the required random string for generating the signature, signature is the required signature, and jsApiList is the required list of the needed JS interface.
2. After WeChat authentication is successful, call wx.chooseImage ({ count:1, sizeType: ('original','compressed'), sourceType: ('album','camera'), success: function (res) { var lolcalIds = res.localIds; } }); The count here can specify the number of photos to select (default 9), sizeType can specify the original or compressed image (default both), sourceType can specify the source is an album or camera (default both), after the successful call, it will return the local ID list of the selected photos, localIds. You can use localID as the img tag's Src attribute to display the image, but when localID is not easy to operate, you can use wx.getLocalImgData to convert lolcalIds into the base 64 format to display the image. Send it to the back end to generate the urls and the previews. For example, you can use wx.previewImage({ current: '', });(You need to add the full current value and other related parameters).
res.wx.qq.com/open/js/jweixin addition, you need to pay attention to the development of the Weixin Official Accounts. You need to set the security domain name of the JS interface. In the public account settings- > function settings, fill in the "JS interface security domain name". After setting it, you can call the open JS interface of WeChat under this domain name. When introducing the JS file, you can choose to use the following options: Also, all pages that require the JS-SD must first be injected with configuration information. The same Url only needs to be called once. For the web app of the SPA that changes the Url, it can be called every time the Url changes (note the related features of the Android WeChat client).
<a href="/?from=ask_words" style="color:red" target="_blank">Read more exciting novels for free</a>