CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Problems with Pure Asp Upload scritp

Print topic Send  topic

Author Message
carflamm
Posted: 09/01/2003, 6:25 AM

Hello..

I'm trying to use Pure Asp Upload scritp but the problem is that with TXT files it's able to upload, but when I try to upload a gif or jpeg files it isn't able to upload. It creates a file with 0Kbyte length.

Can someone help me?

Thankx

Carflamm
phaider
Posted: 09/02/2003, 4:55 AM

Carflamm,
did you check the maximum file size in the property window of the upload, or did you check fully access rights to the destination directory?
Rgds
Peter
Hamilton
Posted: 09/02/2003, 5:36 AM

Check all of your settings and permissions on the directories utilized by the file upload component.

Step 1) Click on the 'root node' of the Tree Menu on the left causing the properties window to display the "File Upload Component" property.

Make certain it specifies the "ASP/VBScript Upload..."

Step 2) Select the form that you placed the upload component on.
Click on the "CCS tag" to select the Upload Component.
After selecting the component, the properties window will display a number of properties including;

Control Source
Temporary Folder (which defaults to %TEMP)
File Folder
Allowed File Masks
Disallowed File Masks
File Size Limit

Create a folder for uploading the files to - by creating a subfolder within your site, which we'll call "tmpDocs".

This is where the files will be temporarily uploaded into.

Next we need to allow IUSR_Internet or IWAM_Internet access to that directory - at the file level.

Open windows explorer and perform a right click on the tmpDocs directory and select the 'properties' option.

Select the Security Tab and add IUSR_... or IWAM_... as is appropriate (intranet or internet user)...

Place "Allow" check marks against 'Read' and 'Write' and 'Modify' for the IUSR_... or IWAM_.. user.

Now, in the properties window - type the path into the temporary folder property... e.g, c:\inetpub\wwwroot\intranet\tmpDocs

Next, create a directory outside of IIS - e.g., on your D:\ drive for instance. Call that directory "DocStorage".

Repeat the steps you did for tmpDocs assigning the same permissions via the properties window.

Next, type the path into the "File Folder" property... e.g, D:\DocStorage

What's happening here is that the ASP upload component will upload the component into the Temporary Folder - then move the file - to a safer area - on your D Drive.

This is a nice feature, since anyone perfoming a 'front page download' of your site would probably get all the docs, etc otherwise.

By moving the file outside of the INETPUB\WWWROOT area you can avoid this anoyance and potential security risk.


Next, let's make sure the "Allowed File Masks" property has an * against it - and that the "Disallowed File Masks" property is empty.

Also, increase the "File Size Limit" by adding another (0) zero to the end of it making it "1000000"

You can adjust these last few properties to better reflect the files you do and don't want to allow, but for now - while you're testing - leave them as flexible as possible as mentioned above.

We haven't set the control source yet.

If your 'Documents Table' doesn't have a char field (text if using MS Access) to hold the file name, you need to create one... call it "SystemFileName" or something... this field will hold the unique file name of the uploaded document.

set the Control Source Property to that field name... e.g., SystemFileName.

We should be done. You can now compile and test what we've done.

Your file should now upload properly having first been uploaded to the tmpDocs directory then moved to the d:\DocStorage directory... notice that tmpDocs is now empty and DocStorage contains the file just uploaded.

I hope this helps.

__________________
Martin Hamilton
DataObjx.Net

Carflamm
Posted: 09/02/2003, 7:13 AM

But why I can upload text files and cannot upload file with jpg, bmp, gif extension?

My settings and permissions on the directories utilized by the file upload component are correct! ..

I'll try again with the Hamilton's solution.

Thank you
DS
Posted: 09/02/2003, 12:39 PM

CCS Upload component has the "Allowed File Masks" property where you can specify which file types are allowed. Try setting it to "*" instead of "*.txt" (or similar) if that's what you have now.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.