Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-30
4
Medium Priority
?
403 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 1000 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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 was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

610 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