Solved

Upload a file from a subdomain to the main domain

Posted on 2008-10-02
10
273 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
How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

 

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

730 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