CN102970325A - File upload method and system - Google Patents

File upload method and system Download PDF

Info

Publication number
CN102970325A
CN102970325A CN2012103947413A CN201210394741A CN102970325A CN 102970325 A CN102970325 A CN 102970325A CN 2012103947413 A CN2012103947413 A CN 2012103947413A CN 201210394741 A CN201210394741 A CN 201210394741A CN 102970325 A CN102970325 A CN 102970325A
Authority
CN
China
Prior art keywords
file
uploaded
upload
activex object
server
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2012103947413A
Other languages
Chinese (zh)
Inventor
付正全
刘成平
刘正伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Beijing Electronic Information Industry Co Ltd
Original Assignee
Inspur Beijing Electronic Information Industry Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Beijing Electronic Information Industry Co Ltd filed Critical Inspur Beijing Electronic Information Industry Co Ltd
Priority to CN2012103947413A priority Critical patent/CN102970325A/en
Publication of CN102970325A publication Critical patent/CN102970325A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a file upload method and a system. The method includes loading an Active X object for uploading a file when a control for uploading the file is not locally loaded; starting the Active X object; and when the file to be uploaded is acquired, calling the Active X object to upload the file.

Description

A kind of file uploading method and system
Technical field
The present invention relates to computer application field, relate in particular to a kind of file uploading method and system.
Background technology
The upload function of file is very general in based on the development mode of B/S.It allows the upload file of user end to server end, no matter but adopt which kind of development language, just can realize uploading behind the file that mostly all needs the client user to select to upload by document uploading control.In today of cloud computing technology fast development, data service presents that data volume is large, file operation trend frequently, and traditional File Upload mode can not satisfy our demand.
At present, mainly contain dual mode based on the File Upload of web mode: namely adopt http protocol and File Transfer Protocol to realize, wherein:
At first to adopting http protocol to realize that File Upload describes:
Among the Html in the past, list can not be realized uploading of file, and how much this has limited the function of some webpages.RFC1867 standard (being the File Upload of realizing among the Html based on list) his-and-hers watches nonoculture has gone out expansion, has increased a Form Element<input type=file 〉.By using this element, browser can generate an input frame and a button automatically, and input frame can be filled in local filename and pathname for the user, and button can allow browser open a file choice box for the user selection file.Its upload procedure is as follows:
The file that step 1, client user's selection will be uploaded
Step 2, server obtain the data flow that user end to server sends
The file format that step 3, analysis are uploaded
Step 4, according in the file destination of analysis result with a plurality of files successively export server end.
Secondly, adopt File Transfer Protocol to realize uploading of a plurality of files
And File Transfer Protocol is the agreement that is used for transmitting file on the Internet, has stipulated the standard that the upper file of Internet transmits mutually.The specific implementation process:
Step 1, connect with ftp server;
The transmission means of step 2, initialization files comprises ASCII and BINARY dual mode;
Step 3, with file output in file input stream;
Data in step 4, the inlet flow are read in the byte arrays;
Data in step 5, the byte arrays write output stream (writing data on the network linking).
Just copied to server end with a source file file of the same name like this.
We can find out and utilize the http protocol upload file need to use document uploading control by above dual mode, and are then helpless for the File Upload that does not adopt document uploading control; Adopt File Transfer Protocol to realize that uploading of a plurality of files is fairly simple, realize easily.Generally be the program of the client of writing, but the safety of server end arrange can more complicated.In addition, FTP also has following shortcoming: data-transmission mode is unreasonable, working method design is unreasonable,, cryptosecurity strategy imperfection inharmonious with fire compartment wall work and efficiency of transmission are low etc., has had the scholar to propose the viewpoint that file transfer protocol (FTP) (FTP) will be withered away.Based on above analysis, how a kind of automation File Upload scheme is provided is the technical problem that needs to be resolved hurrily.
Wherein document uploading control refers to the Form Element<input type=file in the html language 〉.
Summary of the invention
The invention provides a kind of file uploading method and system, the technology technical problem that solve is in the system based on the B/S framework, how to realize the upload function of file in the situation that does not adopt document uploading control
For solving the problems of the technologies described above, the invention provides following technical scheme:
A kind of file uploading method comprises:
When not loading the control for upload file in this locality, load an ActiveX object that is used for upload file;
Enable described ActiveX object;
After getting access to file to be uploaded, call described ActiveX object upload file.
Preferably, described method also has following features: described ActiveX object also is used for file conversion to be uploaded is become the character stream of binary system or 16 systems.
Preferably, described method also has following features: described method also comprises:
Obtain server and ActiveX object is allowed the configuration of the file uploaded;
Describedly call described ActiveX object upload file, comprising:
After obtaining file to be uploaded, allow the file uploaded according to the server that obtains in advance, judge that described to be uploaded whether the permission upload;
Only when allowing to upload, file conversion to be uploaded is become binary-coded character stream.
Preferably, described method also has following features: the routing information of described file to be uploaded obtains in the following way:
Mode one: read the routing information that writes in advance;
Mode two: the information that receives the path of user's input.
A kind of file uploading system comprises:
Charger when being used for not loading in this locality the control for upload file, loads an ActiveX object that is used for upload file;
Enable device, link to each other with described charger, be used for enabling described ActiveX object;
Calling device is used for calling described ActiveX object upload file after getting access to file to be uploaded.
Preferably, described system also has following features: described ActiveX object also is used for file conversion to be uploaded is become the character stream of binary system or 16 systems.
Preferably, described system also has following features:
Described system also comprises:
Deriving means is used for obtaining server allows the file uploaded to ActiveX object configuration;
Described calling device comprises:
Judge module is used for after obtaining file to be uploaded, allows the file uploaded according to the server that obtains in advance, judges that described to be uploaded whether the permission upload;
Modular converter only is used for when allowing to upload file conversion to be uploaded being become binary-coded character stream.
Preferably, described system also has following features:, the routing information of described file to be uploaded obtains in the following way:
Mode one: read the routing information that writes in advance;
Mode two: the information that receives the path of user's input.
Owing to can freely be loaded in the browser by ActiveX object, if load one can upload file ActiveX object, when then not loading the control for upload file in this locality, just can realize uploading file by calling this object.
Further, transfer file to be uploaded to binary system or hexadecimal character stream if load ActiveX object, realize uploading of file by transmitting this character stream.
Description of drawings
Fig. 1 is the schematic flow sheet of file uploading method embodiment provided by the invention;
Fig. 2 is the structural representation of file uploading system embodiment provided by the invention.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, the present invention is described in further detail below in conjunction with the accompanying drawings and the specific embodiments.Need to prove that in the situation of not conflicting, the embodiment among the application and the feature among the embodiment be combination in any mutually.
Fig. 1 is the schematic flow sheet of file uploading method embodiment provided by the invention.Embodiment of the method shown in Figure 1 comprises:
Step 101, when not loading the control for upload file in this locality, load an ActiveX object that is used for upload file;
Step 102, enable described ActiveX object;
Step 103, after getting access to file to be uploaded, call described ActiveX object upload file.
Owing to can freely be loaded in the browser by ActiveX object, if load the ActiveX object of an energy upload file, then in the situation of not using control on the file, just can realize uploading file by calling this object.
Different from transmission character stream in the prior art, file is carried out with binary-coded character stream
Optionally, when using ActiveX object to carry out File Upload, in order to reduce the data volume of uploading, described ActiveX object also is used for file conversion to be uploaded is become the character stream of binary system or 16 systems.
Consider that it is that client oneself triggers that ActiveX object is uploaded to server, if client upload virus document etc., can directly affect the normal operation of server.Therefore following improvement project is proposed:
Described method also comprises:
Obtain server and ActiveX object is allowed the configuration of the file uploaded;
Describedly call described ActiveX object upload file, comprising:
After obtaining file to be uploaded, allow the file uploaded according to the server that obtains in advance, judge that described to be uploaded whether the permission upload;
Only when allowing to upload, file conversion to be uploaded is become binary-coded character stream.
Wherein, the routing information of described file to be uploaded obtains in the following way:
Mode one: the routing information that writes in advance; For example, when writing the code of ActiveX object, write paths information on its code, when this ActiveX object was carried out, nature can read routing information;
Mode two: the information that receives the path of user's input; For example, eject a dialog, allow user's input path information in dialog box.
Certainly, for server, with identical in the prior art, receive file parameters after, the file of the same name that file parameters is saved as with form gets final product, and repeats no more herein.
Embodiment of the method provided by the invention provide a kind of based on the web mode not dependent file select the automation file uploading method of control, client does not need select File to select control only need to provide the absolute path of client file can realize that the automation of file uploads, only be implemented in easily in the situation that does not need user intervention the absolute path of specified document and carry out File Upload, or the batch of a plurality of files is uploaded.
Fig. 2 is the structural representation of file uploading system embodiment provided by the invention.System shown in Figure 2 embodiment comprises:
Charger 201 when being used for not loading in this locality the control for upload file, loads an ActiveX object that is used for upload file;
Enable device 202, link to each other with described charger 201, be used for enabling described ActiveX object;
Calling device 203 is used for calling described ActiveX object upload file after getting access to file to be uploaded.
Wherein, described ActiveX object also is used for file conversion to be uploaded is become the character stream of binary system or 16 systems.
Optionally, described system also comprises:
Deriving means is used for obtaining server allows the file uploaded to ActiveX object configuration;
Described calling device 203 comprises:
Judge module is used for after obtaining file to be uploaded, allows the file uploaded according to the server that obtains in advance, judges that described to be uploaded whether the permission upload;
Modular converter only is used for when allowing to upload file conversion to be uploaded being become binary-coded character stream.
Wherein, the routing information of described file to be uploaded obtains in the following way:
Mode one: read the routing information that writes in advance;
Mode two: the information that receives the path of user's input.
Owing to can freely be loaded in the browser by ActiveX object, if load one can upload file ActiveX object, when then not loading the control for upload file in this locality, just can realize uploading file by calling this object.
The above; be the specific embodiment of the present invention only, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, all should be encompassed within protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the described protection range of claim.

Claims (8)

1. a file uploading method is characterized in that, comprising:
When not loading the control for upload file in this locality, load an ActiveX object that is used for upload file;
Enable described ActiveX object;
After getting access to file to be uploaded, call described ActiveX object upload file.
2. method according to claim 1 is characterized in that, described ActiveX object also is used for file conversion to be uploaded is become the character stream of binary system or 16 systems.
3. method according to claim 1 is characterized in that, described method also comprises:
Obtain server and ActiveX object is allowed the configuration of the file uploaded;
Describedly call described ActiveX object upload file, comprising:
After obtaining file to be uploaded, allow the file uploaded according to the server that obtains in advance, judge that described to be uploaded whether the permission upload;
Only when allowing to upload, file conversion to be uploaded is become binary-coded character stream.
4. method according to claim 1 is characterized in that, the routing information of described file to be uploaded obtains in the following way:
Mode one: read the routing information that writes in advance;
Mode two: the information that receives the path of user's input.
5. a file uploading system is characterized in that, comprising:
Charger when being used for not loading in this locality the control for upload file, loads an ActiveX object that is used for upload file;
Enable device, link to each other with described charger, be used for enabling described ActiveX object;
Calling device is used for calling described ActiveX object upload file after getting access to file to be uploaded.
6. system according to claim 5 is characterized in that, described ActiveX object also is used for file conversion to be uploaded is become the character stream of binary system or 16 systems.
7. system according to claim 5 is characterized in that:
Described system also comprises:
Deriving means is used for obtaining server allows the file uploaded to ActiveX object configuration;
Described calling device comprises:
Judge module is used for after obtaining file to be uploaded, allows the file uploaded according to the server that obtains in advance, judges that described to be uploaded whether the permission upload;
Modular converter only is used for when allowing to upload file conversion to be uploaded being become binary-coded character stream.
8. system according to claim 5 is characterized in that, the routing information of described file to be uploaded obtains in the following way:
Mode one: read the routing information that writes in advance;
Mode two: the information that receives the path of user's input.
CN2012103947413A 2012-10-17 2012-10-17 File upload method and system Pending CN102970325A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2012103947413A CN102970325A (en) 2012-10-17 2012-10-17 File upload method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2012103947413A CN102970325A (en) 2012-10-17 2012-10-17 File upload method and system

Publications (1)

Publication Number Publication Date
CN102970325A true CN102970325A (en) 2013-03-13

Family

ID=47800205

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2012103947413A Pending CN102970325A (en) 2012-10-17 2012-10-17 File upload method and system

Country Status (1)

Country Link
CN (1) CN102970325A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235792A (en) * 2013-03-29 2013-08-07 东莞宇龙通信科技有限公司 Method and device for operating file
CN104079572A (en) * 2014-06-27 2014-10-01 南京铱迅信息技术有限公司 Website protection method based on character conversion from client to server
CN104599296A (en) * 2013-10-31 2015-05-06 南京思润软件有限公司 Realization method for uploading and compressing pictures on batch on the basis of jspsmartupload
CN105306523A (en) * 2015-08-17 2016-02-03 成都飞机设计研究所 Method for sending file from browser to server
CN105407120A (en) * 2014-09-15 2016-03-16 上海天脉聚源文化传媒有限公司 Method, device and system for transmitting image based on WEB client
CN111352904A (en) * 2020-03-04 2020-06-30 海南金盘智能科技股份有限公司 Method and device for replacing model file

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163138A (en) * 2006-10-13 2008-04-16 阿里巴巴公司 Method and system for uploading document
CN101814971A (en) * 2009-02-24 2010-08-25 肖宏声 Method for transmitting mobile phone file
CN102467520A (en) * 2010-11-10 2012-05-23 金蝶软件(中国)有限公司 Data storage method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101163138A (en) * 2006-10-13 2008-04-16 阿里巴巴公司 Method and system for uploading document
CN101814971A (en) * 2009-02-24 2010-08-25 肖宏声 Method for transmitting mobile phone file
CN102467520A (en) * 2010-11-10 2012-05-23 金蝶软件(中国)有限公司 Data storage method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
于丙超: ""B_S结构实现身份证扫描和自动上传照片"", 《电脑编程技巧与维护》 *
张中秋: ""WEB环境下文件上传技术研究"", 《科技资讯》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103235792A (en) * 2013-03-29 2013-08-07 东莞宇龙通信科技有限公司 Method and device for operating file
CN104599296A (en) * 2013-10-31 2015-05-06 南京思润软件有限公司 Realization method for uploading and compressing pictures on batch on the basis of jspsmartupload
CN104079572A (en) * 2014-06-27 2014-10-01 南京铱迅信息技术有限公司 Website protection method based on character conversion from client to server
CN105407120A (en) * 2014-09-15 2016-03-16 上海天脉聚源文化传媒有限公司 Method, device and system for transmitting image based on WEB client
CN105306523A (en) * 2015-08-17 2016-02-03 成都飞机设计研究所 Method for sending file from browser to server
CN111352904A (en) * 2020-03-04 2020-06-30 海南金盘智能科技股份有限公司 Method and device for replacing model file
CN111352904B (en) * 2020-03-04 2023-05-05 海南金盘智能科技股份有限公司 Method and device for replacing model file

Similar Documents

Publication Publication Date Title
CN102970325A (en) File upload method and system
CN105760159A (en) Website developing method and system
EP3561680B1 (en) Rpc conversion process system and rpc conversion method
CN102043837A (en) Data integration system and method
CN102291437A (en) System and method for realizing application of cross-platform internet
JP2015537277A (en) Service processing method and apparatus
CN105763619A (en) Method and device for communication of client and server
JP5362011B2 (en) Configuring the message processing pipeline
CN104010031A (en) Distributed cooperative method improving application efficiency of Web browser
CN102043836A (en) Data adapting device and method
CN103440111A (en) Method for expanding disk space of virtual machines, host machines and platform
CN103414584A (en) Method for rapidly expanding computer cluster based on P2P network technology
CN101546546B (en) Network data converter and method for controlling data conversion
US20150350268A1 (en) Electronic device and data copy method between electronic devices
CN103399776A (en) Creation method and system for reusable MOCK
CN103561113B (en) The generation method and device of Web Service interface
CN102387136A (en) System and method for converting distributed PPT (Power Point) files into swf (small web format) files
Park et al. An efficient dynamic integration middleware for cyber-physical systems in mobile environments
Tao et al. Hybrid cloud architecture for cross-platform interoperability in smart homes
CN107818073A (en) A kind of dynamic list page is automatically converted to the method and system of the HTML5 pages
CN104516883A (en) Webpage sharing method, device and system
WO2017041550A1 (en) Device simulator communication method and system
CN103838586A (en) System and method for opening file
CN103780642B (en) The sharing files method of network store system
CN104253703B (en) A kind of method and apparatus of communication

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20130313