|
|
 |
Re: FN-FORUM: classic asp and file uploads
date posted 24th July 2007 13:06
Hi Guys,
I used to work on secure networks for the MOD, so we were never allowed to
use third party tools, only what came with NT/2000 server. This mean't we
had to script everything by hand. To prevent you from going through the same
heart ache as myself, here's a rough set of instructions to upload files
with ASP.
The first place to always look for ASP stuff is this respected website,
here's the link which gives information on ASP uploads:
http://4guysfromrolla.com/webtech/LearnMore/Upload.asp
Another place to look, is the W3Schools website, it's a superb site for
beginners to advanced guys. It's like the little black book us developer
geeks carry in our smoking jackets top pocket. This link gives an insight
into ASP's file objects:
http://www.w3schools.com/asp/asp_ref_filesystem.asp
Last of all, this is Microsofts way of uploading without third party tools.
It takes a file, then using HTTP post, reads the file as binary and
reconstructs it onto the webserver. Now word of warning, make sure you test
the file type, as you could upload anything! Also make sure you've setup the
MIME types to allow upto a certain file size limit. I think it's set to
something silly like a meg as default. Anyway here's the link:
http://support.microsoft.com/kb/299692
Now if you've got your head around those, I'll give you the AJAX. But first
make sure the aboves working, as AJAX is a headache. Then we'll go the next
step.
Neil.
Neil Hook
Partner,
WISPNet
Tel: 0845 8674002
Mob: 0794 3812739
On 24/7/07 13:01, "Dave" [EMAIL REMOVED] wrote:
>
> Neil
>
> Please point, I may have need of that type of solution.
>
> Cheers
>
> Dave
> -----Original message-----
> From: Neil Hook [EMAIL REMOVED]
> Date: Tue, 24 Jul 2007 11:54:05 +0100
> To: "FN-FORUM / [EMAIL REMOVED] [EMAIL REMOVED]
> Subject: Re: FN-FORUM: classic asp and file uploads
>
>>
>> Hi,
>>
>> The way I do it, is normally check using ASP whether the filename exists
>> within the upload folder and if so, whether the date created is within a few
>> minutes/hours.
>>
>> If you then combine that with some Java/AJAX you can perform validation
>> procedures. Personally I prefer AJAX as it's transparent to the end user and
>> makes a great GUI.
>>
>> If you need more info, I can point you to a good article.
>>
>>
>> Neil Hook
>> Partner,
>> WISPNet
>> Tel: 0845 8674002
>> Mob: 0794 3812739
>>
>>
>>
>> On 24/7/07 12:16, "chris hill" [EMAIL REMOVED] wrote:
>>
>>>
>>> Morning!
>>>
>>> I'm having a few problems getting file uploads to work with classic
>>> asp. I know its not very good at this sort of thing, and that usually
>>> a payed-for solution is best but that isnt an option here. I have a
>>> free script which will quite happily upload a file posted via a form,
>>> which is great - however the form I need to build can have up to 4
>>> optional files and I need to check if they've been sent before I try
>>> to upload them.
>>>
>>> my issue at the moment is, how the hell to you check if a file has
>>> been uploaded or not? usually I test if there has been input in a form
>>> field by using something like
>>>
>>> if len(request.form("blah")) > 0 then...
>>>
>>> but with files it always returns '0' so that doesn't work! I've been
>>> battling with this all morning and I'd really appreciate some help
>>> before I go bonkers.
>>
>>
>>
>> --
>> Freelancers, contractors earn more with Prosperity4
>> Call 0870 870 4414 or visit www.prosperity4.com
>> and benefit from Inland Revenue approved expenses today.
>>
>> To advertise here: http://www.freelancers.net/advertising.html
>>
>>
|
 |
|