Solved

File upload script working on local server but not remote server despite READ/WRITE permissions set correctly

Posted on 2006-11-30
4
371 Views
Last Modified: 2008-01-09
I have been using Lewis Moten's script for file uploading, ensuring unique filenames, limited filesize and file extensions

[http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8525&lngWId=4]

I have deployed it successfully on a number of sites, but I have now encountered an issue that i cannot resolve,

I have the script working fine on my local server (IIS) but on the remote hosting server it presents as though it is working fine, gives no errors, but files do not upload!

Does anyone have any ideas? The folder it is uploading has READ/WRITE permissions for the ASP USER, and i would presume there would be error messages if this wasn't the case anyway.

The script that i'm using to call the upload is:

<!--#INCLUDE FILE="clsUpload.asp"-->
<%
Dim Upload
Dim FileName
Dim Folder

Set Upload = New clsUpload
name = Upload("name").Value
email = Upload("email").Value
comments = Upload("comments").Value
agree = Upload("agree").Value

' If file size is greater then 1 MB
If Upload("File1").Length > 2548576 Then

      ' Notify user of the error.
      Response.Write "File size must be 2 megabytes or less"
      
      ' Stop all execution past this line.
      Response.End
      
End If


' Grab the file name
FileName = Upload.Fields("File1").FileName

' Grab file extension
Ext = Upload.Fields("File1").FileExt

' Check to see if file extension is valid

      Select Case Ext
            Case "GIF", "BMP", "PNG", "JPG", "TIFF", "TIF", "DOC", "RTF", "PDF", "EPS", "JPEG"
                  FileOK = True
            Case Else
                  FileOK = False
      End Select

      ' If file was not valid
            If Not FileOK Then
                  ' Notify user of error
                        Response.Write "Invalid file extension."
      
                  ' Stop all execution after this line.
                        Response.End
            End If


' Get path to save file to
Folder = Server.MapPath("subs") & "\"

' Set the file name to be unique.
FileName = Upload.UniqueName(Folder, FileName)

' Save the binary data to the file system
Upload("File1").SaveAs Folder & FileName

' Release upload object from memory
Set Upload = Nothing
%>
0
Comment
Question by:blurredvision
  • 2
  • 2
4 Comments
 
LVL 13

Accepted Solution

by:
bigbillydotcom earned 250 total points
ID: 18053574
you need to add read/write permissions for IUSR_machinename and IWAM_machinename
0
 

Author Comment

by:blurredvision
ID: 18054890
Thanks BBDC, I'll check those settings with the server admin but it may take a couple of days to get a response out of him...
0
 
LVL 13

Expert Comment

by:bigbillydotcom
ID: 18054935
yikes!
0
 

Author Comment

by:blurredvision
ID: 18061988
Ok, serveradmin guy actually logged on over the weekend and did update the permissions (in fact, he confirmed that the previous permissions change hadn't been made -- which makes me wonder why I didn't receive an error message!).

Anyway, all working now - thanks BBDC!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Current Date/Time SQL Azure 12 96
SQL Query Join 9 53
How to speed up an ASP/MS SQL web application 6 62
Update field in order 21 108
I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now