Solved

Upload a file from a subdomain to the main domain

Posted on 2008-10-02
10
278 Views
Last Modified: 2012-05-05
I want users to be able to upload pictures from a subdomain to a folder on the mail domain.  II am trying to set up my own web server using window 2003. It works on the current sever the site is on but I cannot get it to work on the new server. The code is attached.  The code works on the other server so I'm wondering if it is a windows or firewall issues.  I've look at both but cannot figure out how to get it to work.:

Thanks,

Scott

Dim MyUploader
												Set MyUploader = New FileUploader
																			
												MyUploader.Upload()
														
												Dim File
												Dim myFile
												Dim msErrorMsg ' holds error message if any variables are blank
	
												msErrorMsg = ""
								
												For Each File In MyUploader.Files.Items
													File.FileName=Left(File.FileName,Len(File.FileName)-4) & "(" & request.Cookies("userID") & ")" &  Right(File.FileName,4)
													myFile = File.FileName 
													'response.Write("<br>" & File.FileSize)
													if File.FileSize > 5242880 THEN
														msErrorMsg = "<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; - Sorry, the picture is too big, please resize and try again!<br>"
								
														If InStrRev(msErrorMsg, "<br>") <> Len(msErrorMsg) - 6 Then
															msErrorMsg = msErrorMsg & "<br>"
														End If
				
														'Set the Session error msg for display after redirect
														Session("msErrorMsg") = msErrorMsg		
														Session("Corrections") = "Yes"
																
														Response.Redirect("myAccount.asp?view=purchaseAd&action=uploadPic")
													END if
													response.Write("<br>" & File.ContentType)
												NEXT
																						
												sql="SELECT * FROM users WHERE userID=" & request.Cookies("userID") & ""
												set rs=Conn.Execute(sql)
												response.Write(myFile)	
												
												For Each File In MyUploader.Files.Items
													File.SaveToDisk "C:\pathtofolder\images\banners\"
												Next
 
...

Open in new window

0
Comment
Question by:judoscott
[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
  • 6
  • 4
10 Comments
 
LVL 10

Accepted Solution

by:
slamhound earned 245 total points
ID: 22630336
When you say it doesn't work, what do you mean? How far do you get? Do you get any error messages?

Make sure that the FileUploader is installed, can write to the upload directory and has administrator rights on the new machine. You can limit it's rights once you've got things working.
0
 

Author Comment

by:judoscott
ID: 22630757
It acts as if it is working but when I log onto the machine through remove desktop the file is not there.  How do I give the file uploader administrative rights?

Thanks,

Scott
0
 
LVL 10

Expert Comment

by:slamhound
ID: 22630887
Sounds like we're on the right track then. The file is uploaded but the uploader/IIS doesn't have the rights to save it to the folder.

The user is usually called something like IUser and is the same one IIS uses for it's system things. But it all depends on how your uploader is configured.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 

Author Comment

by:judoscott
ID: 22630936
I gave the IUSR admin right but it still isn't working.   I'm not sure how to check the configureation of the uploader.  Do you mean the upload.asp file or the MyUploader function?

Thanks,

Scott
0
 
LVL 10

Expert Comment

by:slamhound
ID: 22631036
I mean the FileUploader com object. There needs to be something installed on the server to be able to upload files. Whatever this is, it needs to have the appropriate run and access rights.

If it's on the server but not running, it might have to be registered using:
regsvr32 <full path and filename of the dll>
0
 

Author Comment

by:judoscott
ID: 22631042
I was able to upload to the subdomain just not to the main domain from the subdomain.  Wouldn't that mean it is installed and registered?  
0
 
LVL 10

Expert Comment

by:slamhound
ID: 22631374
If you are able to upload anything on that comptuer then yes, it's registered and working.

I'm now confused about the domain/subdomain thing. What is the domain and what is the subdomain?
0
 

Author Comment

by:judoscott
ID: 22643324
The domain is currently an IP address.  I'm trying to get the site up and running before I move it over but the way it works on the live site is that when users register on the register.tellyourtestimony.com the user uploads an image to the domain www.tellyourtestimony.com.

Scott
0
 

Author Comment

by:judoscott
ID: 22646421
Hey,
I just checked and I guess I had given the users on the main domain write permissions and not on the sub-domain.  I just tried it on the sub-domain and it now works.  Sorry for wasting your time.  I'll give you the points since you gave me things to check and if the uploader had not be registered I would have had to go that route and for your time!

i appreciate it.

Scott
0
 

Author Closing Comment

by:judoscott
ID: 31502570
Thanks again for your help!
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

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…
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…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

695 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