Find Web Developers
Find Web Developers

Archive for the ‘Uncategorized’ Category

How to Add File Upload Support to Your Web Site

Monday, August 27th, 2018


Providing the ability for visitors to your web site to upload files from their computer allows for the implementation of some very powerful features, such as for example letting your users share files with other visitors, or decorate their online presence on your site with an identifying portrait or avatar. In general, allowing for a file upload provides an easier way to share a large amount of data rather than extensive and tedious form-filling. However, while the file upload feature has long been supported by most Internet browsers, the precise details of how it is done can be quite tricky; the devil is indeed in the details. In order to correctly use this feature, you will need to perform some work both in the HTML and on the server side, and if you are writing client software to upload the file to an existing web site, you will need to know some details.

In the HTML and Browser

Adding a file upload button to a web page is relatively easy; it is just another type of INPUT field within an HTML FORM. Setting the type attribute of the INPUT field to “file” will provide an input field that allows file selection. Note that the actual upload of the file requires a little bit more work, including some server-side coding, which will follow shortly. The INPUT field may have other attributes set on it, such as size, which will allow control over the size of the display of the selected file, which should be very similar to a text field.

At this point, it is already worth noting that this HTML is likely to vary in appearance considerably from browser to browser. Typically, the form control thus created will consist of what looks like a text field, accompanied by a button that will launch the system file selector. Already, the appearance of the word “looks” should indicate there are possibly some accessibility issues with using this control. In both Internet Explorer and Firefox on Windows, the control appears as a text field with a button labeled “Browse…” next to it, with a few other visual differences. In Google Chrome, the button is labeled “Choose File”, and the text area where the name appears initially begins saying “No file chosen” and is just regular HTML text, not a text input field. There is a little control over the appearance of these visual elements via CSS, but some features, such as the actual text on the button, are chosen by the browser, not by the web developer. Furthermore, the button now means there are two button elements in the HTML FORM, not just a standard “Submit” button. This may cause some issues for browser users who are visually impaired or who use a different input method other than a mouse. In many ways, the appearance of the form may be unfamiliar to users, so your page should contain sufficient explanatory text, should be tested on many browsers, and perhaps should also provide an alternative method of supplying the file data.

Before leaving the HTML, there is one other change that needs to be made to a standard FORM – the enctype attribute of the form needs to be set to “multipart/form-data”. This is the most common omission when setting up a file upload form; if the enctype is left at its default value, “application/x-www-form-urlencoded”, your server will not receive the contents of the file at all, just the file name! This leads us on to the next observation; since the format of the data returned by the browser will be different, any standard form handling code you have will not work. You may need to make matching server changes as well.

On the server

As mentioned above, changing the encoding of the browser response to “multipart/form-data” is necessary so that actual file data is sent to the server; the standard form encoding does not handle arbitrary file sizes well. The encoding is based on the MIME standard for sending multipart messages, most recognizably used in email for file attachments. This makes sense since you are in effect attaching a file to a browser response, but note that the mechanism actually supports multiple files if necessary. Indeed, if there are other INPUT fields in your form, each of their results will also be returned as if they were a file attachment. This means the standard form handling code you have is unlikely to work.

Exactly what needs to be done on the server side depends highly on your server technology and the access rights you have on your site. You may need to contact your web hosting company, for example, to see if they already have a “canned” upload script that you could use. A blog widget or similar inclusion on a third-party site probably will not let you use this functionality. If you are the web developer, you should be able to search for “file upload” in your platform documentation; for example, Perl users will find file upload is supported in the module.

At this point, if what needs to be done appears too difficult, you should consider whether implementing file upload is really what you need, and be wary that there are many security and complexity issues that you may have to handle. What will you do with the files once they arrive? Where will you store them? What if, either accidentally or maliciously, a client tries to send you a huge file? What if the file never makes it to its destination? In cases like this, you may wish to consider an alternate provider to give you file upload capabilities. One use case was, for example, allowing your users to upload a picture or avatar of themselves. There are plenty of services to do that, such as Gravatar; your users might even prefer to see you integrate with Facebook or Twitter.

In client software

Nowadays, it is quite normal for programs other than web browsers to connect to web pages. If you are a developer for software that runs on smartphones, you may find yourself in a position where you need to upload a file to a web site without launching the browser. Again, the precise details vary depending on the platform you are using. Java developers may be familiar with the Apache HttpClient collection of utilities. Creating an HTTP POST using HttpClient is well-documented elsewhere, and a quick search for multipart posting highlights a MultipartPostMethod that is deprecated. The correct way in this case to post is to build a MultipartRequestEntity made up of one or more Part objects; a Part object can be configured to contain, among many other things, a file. A call to setRequestEntity() on the POST method will do exactly what is needed in this case.

What next?

Being able to upload a file to your web site opens the doors to some exceptionally powerful functionality, but the details seem to be a bit sparse online. You may go ahead and check RFC 1867, the original proposal dating back to 1995, and you may wish to try out this functionality in as many different browsers as you can find. You will most likely be surprised at the differences in look and feel. However, it is a good tool to have available in your web development arsenal, and the techniques illustrated here come in useful, even in modern web development environments.

Internet Based Business and Relevance of Website Design and Development

Sunday, August 26th, 2018

Gone are days when the applications of the internet were merely restricted to data transfer. Nowadays the internet and its applications have shrunk the globe to such an extent that the buyer can have accesses to the seller within seconds.

Why is the website necessary?

The word website if examined superficially is a combination of two words; “web” and “site”. This refers to the location of a business identity on the internet. When compared to the conventional business operations, the internet can be compared to a market and the website can be considered a shop or office. Form this sentence itself one can come to know the relevance of website. Having a website has now become a necessity just because of competitive market and cost effectiveness. The competition among the business identities has compelled the businesses to be accessible by the buyer at the earliest. The adage saying “the early bird takes the worm” is apt in this scenario. Usually the website connects the buyer directly with the manufacturer, getting rid of the costs pertaining to the middle men. This makes the product or service cheaper.

Something about website development:

The utility of the website needs to be optimized to generate maximum revenue. This optimization of the website utility is called website development. Website development starts with the planning about website design and is a never ending process (except in the circumstances of the business identity getting liquidated). Some of the phases of website development are website design development, open-source software customization website application development, web-based database programming, content management system, web development services, e-commerce solution, and many more.

The initial phase of the website development is very critical because it pertains to the planning of what has to be displayed through the website. This needs to consider the buyer behavior and preferences. This phase is also about the technology that is going to be used to publish the website on the internet.

Usually the professional website developers take into consideration the elements of search engine optimization (SEO) in the initial stages of website development. This is because large scale amendments in the content are hardly possible after the website is designed. Some of the elements for SEO are key words, incoming links, and keyword phrases, outgoing links, speed of downloading and navigational ease.

The main thrust of website development is attracting as much traffic as possible and converting the maximum number of visitors into buyers. This is possible when the URL features on the top list of the search engines. The website layout needs to be simple, clear and navigation should be easy. The visitor should be able to find what he/she is looking for in the least number of clicks.

A website can not only generate new business but if maintained properly, can also keep the competition at bay. This is only possible if the services of a reliable and professional website development company are hired.

Copyright @ 2010

4 Useful Tips for Web Copy

Saturday, August 25th, 2018

Being a web designer or web developer, sometimes can mean that you need to know how to write professional web copy. It may be for your own website, a client’s website, or you might be hiring someone to do it for you. No matter which situation you’re in, it is important that you know a good web copy from a not-so-good web copy.

Below are 4 useful tips that can help you develop or instruct a successful web copy:

Short Paragraphs: At some point with online reading you’ve had to have read one, or several, very long paragraphs. When doing so, I’m sure at least one of the experiences, induced boredom, loss of concentration or the full inability to read it thoroughly. For these reasons, write somewhat simple and short paragraphs for online readers. Typically, online readers or visitors have a very short attention span and don’t want to read a ton of words to know what you’re doing, who you are or what your business does. Keep it short, the visitor will stay longer.

Simple Word Usage: Mentioned briefly above, keeping your use of words at a simple level is a great idea. Don’t fill your paragraphs with intellectual hogwash. People aren’t interested in how well a web designer can craft words. All the visitor wants to know is: who, what, how much and how to contact you. Be polite, professional and informational, but you don’t have to be very technical or abstract.

Break up key elements: For the visitor to have a pleasant experience reading your site, it’s a great idea to break up key points, elements or services by using a bulleted or numbered format. It’s much easier for a visitor to read through and find the important information that they are looking for when the information is broken up.

Create Attention-Grabbing Headlines: For the reader to be drawn in to the content, a great headline is necessary. A great headline will draw the visitor in, and if you place a few sub titles throughout the rest of the content, it will also help break up the information.

Web copy is just as important as the services that you offer because it helps sell those services. Be sure to also proofread and correct grammar and spelling.