Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with uploading a picture to my website when the www. is infron

Status
Not open for further replies.

markhkram

IS-IT--Management
Dec 30, 2008
32
0
0
US
I have a website that I have used the following on:

Well I had to set the uploads directory to 777 in order for it to work... It works great! HOWEVER, it only works when I don't have the www.domainname.com infront of it. It works fine if I have domainname.com only. I've tried contacting the guy and reading through their comments, but can't find anything.

I really need a flash solution that will resize pictures, and then upload them. This one is perfect, but can only work when not using the www. I need it to work for www. Anyone know how to fix it, or can at least suggest a similar application that will do that same thing? I wouldn't mind paying for the app (as long as it is reasonable).

Thanks!
 
Hi

if you are looking for a flash solution why are you asking in the php forum?
 
Hi, good question. It uses .php to send to the flash file, and then a .php file to receive the output of the flash file. As far as I can tell, I think the problem is in the coding that receives the output, as it works perfectly when not using the the address bar. Here is the code that receives the output of the flash:

receiveFile.php
Code:
<?php
set_time_limit ( 240 ) ;

$file=$_FILES['Filedata'];

for($k=0;$k<count($file['name']);$k++){
	$target_path = "uploads/";
	$target_path = $target_path . basename( $file['name'][$k]);
	$orig=$target_path;
	$info = pathinfo($target_path);
	
	$ctr=1; 
	while(file_exists($target_path)){
		$target_path=$info['dirname']."/".$info['filename'].$ctr.".jpg";//.$info['extension'];
		$ctr++;
	}
	
	if(move_uploaded_file($file['tmp_name'][$k], $target_path)) {
	   // echo "status=1&filepath=$target_path&size=".$file['size'];
	} else{
	   // echo "status=0&msg=Error";
	}
}

echo "status=1";

?>
 
what error do you get when using the address bar
is you domain hosting set up to accept wild cards?
ie does a dns lookup on reolve to the same address as yourdomain?

I do not Have A.D.D. im just easily, Hey look a Squirrel!
 
Hi, I'm not sure if it is setup to accept wildcards, I will try to find that out. It resolves the same for both addresses. It doesn't throw an error, it just says "sending files to server..." It should say that for a few seconds and then should say "finished". But it just never finishes when using www. Which confuses me... Do you think there is some configuring I can do on my hosting server?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top