this is what i want to happen, the user uploads the file to the database, (i already have the upload file), now what i want is that the user will be able to download what he had just uploaded to the database. in this case, he will have a chance to either open, save or cancel the download.


please someone help me, i badly need the solutions...:(

Member Avatar for diafol

Just click on the link to the file to download (Depending what type of file it is).

Viewing a file is trickier:

<a href="javascript:browsewin('/apps/dpt/d5/u1.doc')">View u1.doc</a>

[js snippit]
window.open(u,'Browse','width=550,height=400,resizable=yes,status=no,scrollbars=yes,buttons=no,location=no,menubar=no,directories=no,toolbar=no');

You could try that, but it may be browser specific, or the browser needs to be able to open that type of document. Google Chrome won't touch it (Word file).

Cancelling the download, should be left to the browser UI.

sir it does not work...

Member Avatar for diafol

//oops

function browsewin(u){
window.open(u,'Browse','width=550,height=400,resizable=yes,status=no,scrollbars=yes,buttons=no,location=no,menubar=no,directories=no,toolbar=no');
}

I forgot to include the function wrapper. Place this in the head section within <script> tags.

thank you sir to all of your very helping hand, i almost got it already. thank you very much

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.