Solved

GoDaddy messed me up with ASPUpload!

Posted on 2006-11-14
22
2,790 Views
Last Modified: 2008-10-04
I had a backend admin interface working perfectly using ASPUpload using the "Upload.Save" and File.SaveAs "d:\hosting\expatshow\uploads\gallery\" & NewName & File.ext until a few weeks ago.  Then GoDaddy changed something on their server that no longer allows Upload.Save method.  This generated the error below:

Persits.Upload.1 error '800a0028'
This feature has been disabled by system administrator. Use File.SaveVirtual instead.

I've been trying to do this, to no avail.  Here's my current code (forgive the commented out lines - I've tried hundreds of variations):
<%
Set Upload = Server.CreateObject("Persits.Upload.1")
Set UploadProgress = Server.CreateObject("Persits.Upload")
Upload.ProgressID = Request.QueryString("PID")
' Limit file size to 50000 bytes, throw an exception if file is larger
Upload.SetMaxSize 20971520, True

' Intercept all exceptions to display user-friendly error
On Error Resume Next

' Will not overwrite files
Upload.OverwriteFiles = False

' Perform upload
Upload.Save
'Upload.SaveVirtual "../uploads/gallery/"

' Use session ID as the new file name
'NewName = Session.SessionID

For Each File in Upload.Files
      File.SaveAsVirtual "../uploads/gallery/" & File.FileName
Next
%>

The Progress Bar indicates that it uploads the file to the memory.  It just won't write the file to my directory in wwwroot/uploads/gallery.  Any help would be greatly appreciated.  I believe permissions are correct, as it typically generates an error about not having permission to that directory.
0
Comment
Question by:elevatedmarketing
  • 11
  • 8
  • 2
  • +1
22 Comments
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17943776
Hi,
Could you try using server.mappath to determiner where to save the upload?
0
 

Author Comment

by:elevatedmarketing
ID: 17943793
I think I've tried that in several different ways.  Since it's not actually writing the file to any of the directories (just to the server memory apparently), how would you do this?
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17943863
Here's a sample,

Upload.SaveVirtual "/uploads/gallery/xxx.jpg"
or
Upload.SaveVirtual Server.MapPath(".") & "\uploads\gallery\xxx.jpg"

Hope this is useful?
From memory I think I started using Server.MapPath for the same reason as you - the host company blocks Save for security reasons.
SaveVirtual is good, just fiddly to get sorted out the first time!
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17943888
One other thing to try - I have this in my sample code,

Set Upload = Server.CreateObject("Persits.Upload")
'Set Upload = Server.CreateObject("Persits.Upload.1")

I can't tell you why I commented out the second line as it was about two years ago, but I would have done it for a reason and the code works...
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17943941
I've just tested this code as is, on my server,

<%
      Set Upload = Server.CreateObject("Persits.Upload")
      'Set Upload = Server.CreateObject("Persits.Upload.1")
      Upload.OverwriteFiles = False
      Upload.SetMaxSize 3000000, True      

      Upload.SaveVirtual "/uploads/gallery/"
      img1 = Upload.Form("img1")
      imgFilename = Upload.Form("imgFilename")
      Set File = Upload.Files("img1")
      'Response.Write File.FileName
      thisFile = File.FileName

      if Err <> 0 then
            Response.Write "An error occurred:" & Err.Description
      else
            On Error Goto 0
            Set File = Upload.Files(1)
            if File.ImageType = "UNKNOWN" then
                  File.Delete
                  response.write "Error, that file is not a recognised image format.>"
            end if
      end if
%>
0
 

Author Comment

by:elevatedmarketing
ID: 17943965
I've got so many variations now I'm confused.  This is what I currently have.  I've tried both of the above options you suggested (not yet tried your lengthy code) and still nothing.  I'm posting it below for you to take a look:

<%
Set Upload = Server.CreateObject("Persits.Upload")
Set UploadProgress = Server.CreateObject("Persits.Upload")
Upload.ProgressID = Request.QueryString("PID")
' Limit file size to 50000 bytes, throw an exception if file is larger
Upload.SetMaxSize 20971520, True

' Intercept all exceptions to display user-friendly error
On Error Resume Next

' Will not overwrite files
Upload.OverwriteFiles = False

' Perform upload
Upload.Save
'Upload.SaveVirtual Server.MapPath(".") & "..\uploads\gallery"
'Upload.SaveVirtual "../uploads/gallery/xxx.jpg"
'Upload.SaveVirtual "../uploads/gallery/"

' Use session ID as the new file name
'NewName = Session.SessionID

For Each File in Upload.Files
      File.SaveAsVirtual Server.MapPath(".") & "..\uploads\gallery\" & File.FileName
Next  
%>

The reason I have to use the last section File.SaveAsVirtual is because I actually have 12 images I'm uploading at a time.  It worked beautifully before GoDaddy blocked the Save function.
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17944048
Hi elevatedmarketing,
Not to worry, I think you're nearly there.

The virtual save method is relative, which I forgot to mention in the sample I gave you
So your code
File.SaveAsVirtual Server.MapPath(".") & "..\uploads\gallery\" & File.FileName
will assume that uploads/gallery/ is relative to where the script file is.

Does that make sense?


0
 

Author Comment

by:elevatedmarketing
ID: 17944098
not really...  I'll try to map where I want the files to upload.

                      wwwroot
                            |
                            |
            Admin---------------Uploads
                |                            |
     AspUpload_script          Gallery (directory where I want the files to upload to)

Does this make sense at all?  Forgive the crude drawing.  So I want the files to use the AspUpload_script to go up one directory, over one directory and then down one directory into the "Gallery" folder.
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17944142
Hi again,
Another approach to this would be to use

File.SaveAsVirtual Server.MapPath(Application("vroot") & "/uploads/gallery/")

I have used this with saUpload, which is similar to aspUpload.
It's a little bit easier to use because you can specify an address relative to the root rather than to the script.


0
 

Author Comment

by:elevatedmarketing
ID: 17944167
Unfortunately, that didn't work either.  It just won't save the file into the "Gallery" directory.  I'm completely stumped.
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17944187
lovely sketch :)

Could you try this and let me know if it works ?

Upload.SaveVirtual "/uploads/gallery/"
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17944208

Silly question I know, but your permissions are definitely set properly for /uploads/gallery/ ?
0
 

Author Comment

by:elevatedmarketing
ID: 17944233
I'm checking the permissions again.  They were set correctly earlier.
0
 
LVL 6

Accepted Solution

by:
hc0904pcd earned 250 total points
ID: 17944274
Here's a simple test - forget the looping code for now, that will be easy to sort out once the files loading is working.

On page 1, call it test.asp, put this,
<form action='test2.asp' enctype="multipart/form-data" method='post'>
      <input name='img1' type='file' />
      <input name='Submit' type='submit' value='Start Loading' />
</form>

And in page 2, called test2.asp, put this

Set Upload = Server.CreateObject("Persits.Upload")
Upload.OverwriteFiles = False
Upload.SetMaxSize 3000000, True      
Upload.SaveVirtual "/uploads/gallery/"

This works on my server in an environment where I know I have aspUpload, and file permissions set.

0
 

Author Comment

by:elevatedmarketing
ID: 17944286
THAT WORKED!!!!  Unbelievable!
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17944297
Awesome!
I know how you feel because I've been there....
And I reckon the best answer is to strip things back to the absolute simplest of tests, het it working, and then put back the more complex stuff.
good luck with it.
0
 

Author Comment

by:elevatedmarketing
ID: 17944303
Thanks so much.  I'm not sure what you did, but it worked!
0
 
LVL 11

Assisted Solution

by:Rajesh Dalmia
Rajesh Dalmia earned 250 total points
ID: 17944305
I also faced similar problem last week. Then I modified the code as below and now it's working fine

ImageFolderVirtual = "/ApartImages/"
Set Upload = Server.CreateObject("Persits.Upload")
Upload.Save
For Each File in Upload.Files
   File.SaveAsVirtual ImageFolderVirtual & File.FileName
Next


U have to modify the code as per your requirement. Hope this will help u.

For you the ImageFolderVirtual Will be I think "/uploads/gallery/". and make sure that you have Read and Write permission in this online folder.


rdonline1
0
 

Author Comment

by:elevatedmarketing
ID: 17944568
I ended up using a variation of both of your codes.  Thanks so much!
0
 
LVL 11

Expert Comment

by:Rajesh Dalmia
ID: 17944576
Glad I could help.


rdonline1.
0
 
LVL 6

Expert Comment

by:hc0904pcd
ID: 17944595
same here :)
0
 

Expert Comment

by:Minion1
ID: 22642896
HI all,

I recently set up an uploading system for a .csv file on GoDaddy's servers and had this exact same probalem about 2 weeks after the script was running perfectly fine. I think GoDaddy somehow monitors for the Save As function, and then shuts down your application without informing the customer. This problem just seemed wierd.

Anyway, I just wanted to say that I used the Assisted Solution to solve my problem which was almost identical to what elevatedmarketing posted.

 Thanks, all!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

708 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

15 Experts available now in Live!

Get 1:1 Help Now