Solved

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

Posted on 2006-11-30
4
374 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to solve this equation 3 51
Add server behaviors to Dreamweaver CC 2015 2 128
API not working 33 55
App wrap my classic asp based webpages (running on mysql database)? 3 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…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
A short film showing how OnPage and Connectwise integration works.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

930 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

12 Experts available now in Live!

Get 1:1 Help Now