"West Shrine Diary" "07" hard work, find information, thinking, how to do ASP image upload

Source: Internet
Author: User


"West Shrine Diary" "07" efforts to find information, thinking, how to do ASP image upload (2015.07.23 Thursday)


Today forgot to bring a book, directly written in the books on the notes, later or in the book folder;

Learned so long Web application, has not time to do a little, relatively complex points to apply, such as now to consider the image upload, or the next step to strengthen the learning of regular expressions, anti-SQL injection, Verification code implementation, image watermark function, this is really should be as I study the second stage, To do a bit of a relatively complex application function, consider how to make their own website more robust, today is mainly in search of ASP data to learn the picture upload, consider the next JS to realize the Web Rich Text editor, and then began to see the course network of regular expression tutorial, to learn there are many, impetuous no use, day after period good to do accumulation.


1. Initially planned

1.1 Learning to implement ASP upload display image

1.2 Consider implementing a no-component verification code

1.3 Consider implementing the JS Rich Text editor


2. Practical situation

2.1 Due to the cracked PD, so again on the Mac installed Win10, but also good resolution display, began to work with the MacBook again, so first installed sqlserver2012, rebuilt the following table, the previous ASP message Board code to restore the next, consumption of time, In particular, SQL Server installed a connection, a bit of a headache, or the foundation is not solid enough, but naturally because of their neglect of SQL Server, SQL Server's pure Express layout will not be brought to the manager studio, Need to download version with manager studio to use, from another point of view, is my command line operation is too little, back in the study of the MySQL on the MongoDB more attention to accumulate command line operation, naturally this is because I also too much food, many have to grope, No one to teach you have to make good work hard, for their own efforts;


2.2 Then, I looked at the purchase of the Dw6+asp book on the ASP of the knowledge point part, it is a pity that this book is too basic, no I want some functional components of the description, I would like to get from, I want to do the image upload function object Ah, methods, properties, or components, etc. Unfortunately this book did not mention, even the Web site is also rely on DW visual editing, Comparison has no way, buy the wrong book, it seems today's ASP is not find books to buy, or Baidu-based, and then script home, ASP concentration camp to see a lot of ASP knowledge comparison, good learning site, to make good use of


2.3 Constant Baidu information, find about the ASP file upload function of the practice, unfortunately are more chaotic, but the most important thing is that they do not understand the code, so tomorrow to do a good job of research on the object, method, properties, operations, components, and consider exactly what methods to do, Really do not refer to the Web php upload file tutorial, after all, this block is actually more interlinked, but also help to do PHP project, now I can not just consider to do a superficial application, and should consider how to make a little bit of a robust web application, in which continuous learning, to grow their own;

Today, do a picture upload function process thinking: should be the following points:

1, page forms provide form tags    settings enctype= " Multipart/form-data ", which is the Web upload file must be set in the form of a MIME type determination, to ensure that the file can be uploaded, this form to post to the backend URL to the ASP file for delivery requests;

2, ASP to get the uploaded files, it may be to get the binary stream bar, for the time being, It is not yet determined how to get to this file, this step is critical, is to obtain the requested file;

3, start verifying file size, type is not what I want, such as I want to set, less than 2MB, file type is a picture, Of course, in front of the time should be the first to use JS to verify that the file is not in line with my requirements, and then to the server side to verify again;

4, then, find the directory that needs to save the picture, determine whether the directory exists, does not exist the new, and then save the picture, the image name to obtain;

5, the acquired picture name is stored in the database, My intention is to direct the image name in the HTML img under the SRC dynamic transformation,

6, Click Insert Image, you can directly add the image img tag source into the textarea is being entered, and thus also directly displayed, upload messages, limit the maximum incoming two pictures, that is, save two IMG tags, may still consider using regular to match, so first learn the regular is also very necessary, In many places it is necessary to do advanced validation;

Well presumably that is the case, and then I started to find the corresponding solution, naturally this should also help me to learn the code written by others;

Later this to make must be summed up to do a good job, before the first version of the simple function of the summary, is the first stage;


2.4 may be, a little impatient, always feel that anti-SQL injection, XXS attack these blind spots will make my progress is very slow, but fortunately, from the Netizen to get a copy of the defensive code, directly included can be used, and then to read the source, and constantly increase their understanding in this respect, Certainly still need to find some information, from the basic defense AH attack Ah, these web funnel constantly recharge themselves, of course, this needs a relatively long stage, now can basically realize to read some of the OK, so in the verification code, also must first use, and then understand;


2.5 Consider the rich text editor of the practice, I think it is to use JS or jquery or AJS to do, in fact, is the operation of the DOM to the selected text with CSS style, and then save, later or to see someone else's code, to see the specific implementation of their own to do some basic functions, In this part should still first the MU class network JS, jquery class read, and then see some need to use the operation of the DOM skills, anyway, it is not urgent, good study is the most important;


2.6 studied the MU class network regular expression, has not finished, tomorrow after learning to take notes summary, induction, or will forget;


3. Introspection

How to say, there is lost, at least in the continuous efforts, it is certain, but the plan and practice, or have to stress again, I decided in practice still some hesitates, this is not good, no matter what to learn, first one to learn again, do not waste time to hesitate, good implementation plan, or more important things;


4, "enlightenment"

Like introspection, but also not the same introspection, maybe I still a little dislike of ASP bar, after all, really has been eliminated by the era of technology, I do not know how to learn this to me will not have much help, but since the same is the Web technology, and then I was the first internship in the Internet company, so still want to work hard, boil, More learning points is a point, the old technology also has the advantage of old technology, at least relatively more stable, NN, technology is still the same, and is still a scripting language, and so this solid enough flower, to their own further study AH use PHP is also very helpful, language is a tool, to achieve the function is to achieve, Not because of the language differences and no way to achieve certain functions, but may be a little different in the method, or not so good to obtain information or anything, it's okay, as long as I can work hard enough, and then, still have to spend Kung Fu internship js, jquery, Ajax, JSON these, more useful, but also very common, Of course, the best is to be able to do before the start of an Android app to help the next semester to learn Android, may later also consider to do Android it, natural iOS is also very good, but estimated that there is no time, or do not be discouraged, a little to come, refueling!


5. Tomorrow's plan

5.1, to learn the regular expression of class video, do a summary

5.2, step-by-Step reading ASP file upload source code, and their own home to implement

5.3, the ASP message board connected to the database of the problem of processing, to see where the problem is not

5.4, read anti-SQL and XXS source code, how many first understand, then find information to see how to prevent

5.5, continue to learn JS Bar, quickly rich text to do up


Well, every day is pretty fast, tomorrow is the second week to work end, I still on the road, slowly climb, snail like me. To learn, but also to live well.


Copyright NOTICE: If you want to, please share

"West Shrine Diary" "07" hard work, find information, thinking, how to do ASP image upload

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.