Solved

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

Posted on 2006-11-30
4
391 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

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…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

690 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