Upload does not work, no errors

Help!! It's not working for me. How can I???

Upload does not work, no errors

Postby burrug » Thu Jun 10, 2010 2:57 pm

Hello,

Let me first say I think this is a wonderfull project! compliments to the designers!

Though I have implemented the uploadify by the instructions in the PDF-manual and it does not work..
When I point some files and let the script upload my pictures, the indication bars fill up and the script says nothing further..
When I look into my upload folder, defined in the parameters behind 'folder', I see no files uploaded.. :( Also no errors occur..

The userrights on the uploadfolder are full on Everyone.

Does someone know wat I've been doing wrong?

script (form.php);
Code: Select all
<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader'  : 'scripts/Service/Foto/uploadify.swf',
'script'    : 'scripts/Service/Foto/uploadify.php',
'cancelImg' : 'scripts/Service/Foto/cancel.png',
'auto'      : true,
'folder'    : 'scripts/Service/Foto/uploads',
'buttonText': 'Bladeren...',
'multi'     : true
});
});
// ]]>
</script>


uploadify.php;
Code: Select all
<?php
if (!empty($_FILES)) {
   $tempFile = $_FILES['Filedata']['tmp_name'];
   $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';
   //$targetPath = 'scripts/Service/Foto/Temp/';
   $targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
   
   //$fileTypes  = str_replace('*.','',$_REQUEST['fileext']);
   //$fileTypes  = str_replace(';','|',$fileTypes);
   //$typesArray = split('\|',$fileTypes);
   //$fileParts  = pathinfo($_FILES['Filedata']['name']);
   
   //if (in_array($fileParts['extension'],$typesArray)) {
      // Uncomment the following line if you want to make the directory if it doesn't exist
      //if (!is_dir($targetPath)) {
      //   mkdir($targetPath);
      //}
      //echo $tempFile."<br />";
      //echo $targetPath."<br />";
      //echo $targetFile."<br />";
      
      move_uploaded_file($tempFile,$targetFile);
      echo "1";
   // } else {
   //    echo 'Invalid file type.';
   // }
}
?>
burrug
 
Posts: 1
Joined: Thu Jun 10, 2010 2:50 pm

Re: Upload does not work, no errors

Postby sportfisher » Sat Jun 12, 2010 2:56 am

Having the same problems but what I know is that it is calling the uploadify.php it is evaluating the if(!empty($_FILES)) part. Basically $_FILES is empty even when uploading a file. So does anybody have idea of what is wrong
sportfisher
 
Posts: 1
Joined: Sat Jun 12, 2010 2:38 am

Re: Upload does not work, no errors

Postby pfiff_de » Sun Jun 20, 2010 11:06 am

Have your upload folders the correct permission: 777? -- 775 is not enough!
pfiff_de
 
Posts: 11
Joined: Sun May 23, 2010 10:04 am

Re: Upload does not work, no errors

Postby wimwijnen » Fri Jun 25, 2010 12:29 pm

Have also the same problem.
On localhost it works perfect and also on serveral other servers.
But on 1 server it doesn't work. The map is 777 and the situation is the same as on the other servers.
wimwijnen
 
Posts: 3
Joined: Fri Jun 25, 2010 12:06 pm

Re: Upload does not work, no errors

Postby pfiff_de » Fri Jun 25, 2010 3:18 pm

Mhhhh... Create a new PHP-document and insert the folloing code:

Code: Select all
<?php phpinfo(); >?


Upload it to the not working server, open the document in your browser and search for ( Strg + F ) file_uploads. What stands there?
pfiff_de
 
Posts: 11
Joined: Sun May 23, 2010 10:04 am

Re: Upload does not work, no errors

Postby wimwijnen » Sat Jun 26, 2010 7:04 am

File_upload: on
wimwijnen
 
Posts: 3
Joined: Fri Jun 25, 2010 12:06 pm

Re: Upload does not work, no errors

Postby pfiff_de » Sat Jun 26, 2010 1:23 pm

And it doesn't work?! Mhhh...

But have you set/changed your uploadfolder path correctly?
pfiff_de
 
Posts: 11
Joined: Sun May 23, 2010 10:04 am

Re: Upload does not work, no errors

Postby wimwijnen » Sat Jun 26, 2010 1:57 pm

Thank you for your solutions, but I know sure that everyting is correct.
I tried your program on serveral servers in the same situation, same folder, same variables etc. only on the server where I need it the most it don't work.
wimwijnen
 
Posts: 3
Joined: Fri Jun 25, 2010 12:06 pm

Re: Upload does not work, no errors

Postby pfiff_de » Sat Jun 26, 2010 2:40 pm

You can compare the two phpinfo files... When you find the difference you might can solve the problem ;)

:idea: I would use a tool when you compare the files: http://www.google.de/#hl=de&q=compare+files&aq=f&aqi=g10&aql=&oq=&gs_rfai=&fp=48bb631c7c314f0c
pfiff_de
 
Posts: 11
Joined: Sun May 23, 2010 10:04 am

Re: Upload does not work, no errors

Postby manualtranny » Sun Jul 25, 2010 2:51 pm

I'm having the same issue, I think. I have just downloaded the most recent Uploadify version- everything seems to be working on the index.php page of the example, and I have set permissions for everyone on the uploads folder, but no file is uploading.

Did you figure out what is wrong?
manualtranny
 
Posts: 1
Joined: Sun Jul 25, 2010 2:49 pm

Re: Upload does not work, no errors

Postby jeronimocarrizo » Tue Jul 27, 2010 2:26 pm

I'm another one that has the same error. I do not show any error and when I finish the uploadfile can not I get any file in the folder defined.
I try to run the example, I have deployed in tomcat 7.0 and jquery.uploadify-v2.1.0. y Windows 7 Enterprise.


---------------------------------------------------------------------------------------------------------------------------------------------------
Name File: testFileUploaddify.jsp.jsp

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Uploadify Example Script</title>
<link href="sources/css/default.css" rel="stylesheet" type="text/css" />
<link href="sources/css/uploadify.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" src="sources/scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="sources/scripts/swfobject.js"></script>
<script type="text/javascript" src="sources/scripts/jquery.uploadify.v2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#uploadify").uploadify({
'uploader' : 'sources/scripts/uploadify.swf',
'script' : 'sources/scripts/uploadify.php',
'cancelImg' : 'sources/cancel.png',
'folder' : 'uploads',
'queueID' : 'fileQueue',
'auto' : true,
'multi' : true,
'fileDesc' : '',
'fileExt' : '*.jpg,*.jpeg,*.png,*.bmp,*.doc,*.pdf,*.docx,*.gif'
});
});
</script>
</head>

<body>
<div id="fileQueue"></div>
<input type="file" name="uploadify" id="uploadify" />
<p><a href="javascript:jQuery('#uploadify').uploadifyClearQueue()">Cancel
All Uploads</a></p>
</body>
</html>


------------------------------------------------------------------------------------------


Anyone know what could be happening?
Thanks Very much!
jeronimocarrizo
 
Posts: 1
Joined: Tue Jul 27, 2010 1:59 pm

Re: Upload does not work, no errors

Postby joomla_user » Thu Jul 29, 2010 12:28 pm

Same problem here ::

• progress shows up well. No errors at the end. But no file at my serverspace.

• upload in php.ini is set to "on"
• folder-permissions are set to 777
• have tried absolute path prexif with http:// and / --> does not work

Tried to debug some, but I failed >> wrote ( echo "script called!";die; ) at beginning of uploadify.php >> but no output at all.
How can I see that the file is called corectly?

best regards
joomla_user
 
Posts: 1
Joined: Thu Jul 29, 2010 12:14 pm

Re: Upload does not work, no errors

Postby mustang » Wed Aug 04, 2010 9:33 pm

I might have an answer that helps others.
I was also having no success uploading the file and seemingly had no error.

The interface for the form was updated to use Uploadify look/feel.
The file browser opened and allowed me to select multiple files.
The files were listed in the browser/form.
However, each image listed 'http error' (the auto option was also set)

To help trouble shoot the problem, I added some additional options to the javascript that initializes the feature.
The one that helped the most was onError.
It kicked out http 401.

The environment I was working in required users to log in using http auth.
While I had logged in for my browser, the authorization did not seem to apply to whatever transactions were happening between uploadify and the server.

So I guess I am saying "no errors" might be inaccurate.
The code in the first example of this thread was not using the onError option. So nothing was triggered to display/log/etc an error.
Perhaps try creating an onError event handler so you can see what you find.
mustang
 
Posts: 1
Joined: Wed Aug 04, 2010 9:15 pm

Re: Upload does not work, no errors

Postby kheang » Wed Aug 04, 2010 10:42 pm

I had a similar issue with firefox.
Except my HTTP error was 302.
I looked on the forum and online and someone said it was because of sessions.
Im using PHP. So all I had to do following people's suggestions, was to pass the session id and in my uploading script to reload the session using that.
That fixed it for me.

Don't know what your coding in but if you can do that same thing it would probably work.
kheang
 
Posts: 11
Joined: Mon Aug 02, 2010 7:16 pm

Re: Upload does not work, no errors

Postby janper » Mon Aug 09, 2010 12:24 pm

i'm having the same problem. in firebug i found that the upload php script (defaultly uploadify.php) doesn't launch at all! i'm starting a new thread for this

edit: http://www.uploadify.com/forum/viewtopic.php?f=7&t=6136
janper
 
Posts: 4
Joined: Mon Aug 09, 2010 12:16 pm

Re: Upload does not work, no errors

Postby janper » Mon Aug 09, 2010 2:27 pm

ok, i probably have the solution!

the jquery.uploadify.v2.1.0.js sends folderparameter to the uploading php in a messed up form - it is a relative path from the website's root to the file and only works if your php is in the root directory. therefore the path usually doesn't exist and for me it only wokred when the path coincidentally existed even from the position the php was placed.

so i used a simple workaround - i'm sending the correct relative path to the php separately using uploadify's 'scriptData' attribute. don't forget the relative path must start from the php file, so if it's in a subdirectory scripts, it has to start with "../".

the javascript looks like this
Code: Select all
$(document).ready(function() {
   $("#uploadify").uploadify({
      'uploader'       : 'scripts/uploadify.swf',
      [b]'script'         : 'scripts/uploadify_jp.php',[/b]
      'cancelImg'      : 'cancel.png',
      [b]'scriptData'     : {path : '../uploads'},[/b]
      'auto'           : true,
      'multi'          : true
   });
});


and the scripts/uploadify_jp.php like this
Code: Select all
<?php
if (!(isset($_POST['path'])) || ($_POST['path'] == "")) {
      $path="";
   }else {
      $path = $_POST['path'];
      if ($path[strlen($path)-1]!="/"){
         $path.="/";
         }
   }

if (!empty($_FILES)) {
   $tempFile = $_FILES['Filedata']['tmp_name'];
   $targetFile=$path.$_FILES['Filedata']['name'];
      
      if (move_uploaded_file($tempFile,$targetFile)){
         echo "1";
      }else{
         echo "0";
      }

}else{
echo "0";
}
?>


hope this helps!
janper
 
Posts: 4
Joined: Mon Aug 09, 2010 12:16 pm

Re: Upload does not work, no errors

Postby elmonty » Fri Aug 27, 2010 3:48 pm

I am having the same problem. It's not a messed up folder variable. The $_FILES array is empty. Why would that be?

BTW, I cannot search this forum for "$_FILES" because it says "files" is "too common". Bleh.
elmonty
 
Posts: 2
Joined: Fri Aug 27, 2010 3:31 pm

Re: Upload does not work, no errors

Postby shirgans » Tue Sep 07, 2010 2:57 am

Hi,

first of all, this project is awesome. Looks great.

:idea: well, I have the same problem and I think I know what the problem is. at least I hope.
I have tried too many ours to get this thing working, and it seems that there the form is not sending the files.
I have tried my upload script with simple form post with enctype set to multipart/form-data. it worked as expected.

but when having the same input field, and the same upload script, only using uploadify, it's not sending the $_FILES, therefore it's empty.
I have tried to wrap the input inside a form with the correct enctype, and it's not working too.
I have used onError - there is no error shown.

So I as I said - I think I know where the problem is, butI still need a solution. :?

Thanks
shirgans
 
Posts: 1
Joined: Tue Sep 07, 2010 2:49 am


Return to Implementation Help

Who is online

Users browsing this forum: jcopeland, Yahoo [Bot] and 2 guests