473,324 Members | 2,124 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Anyone used uploadify scriptData

228 100+
am having a lot of headache trying to pass values to upload.php

I have tried various ways to pass one parameter but it is always empty in upload.php.

I have seen the sample but I failed to get it right nor all the other tutorials outthere helped me out.

here is the code i am using

Expand|Select|Wrap|Line Numbers
  1. $(document).ready(function() {
  2.     $("#UploadImages").fileUpload({
  3.     'uploader': '/erivoices/fbox/uploader.swf',
  4.         'cancelImg': '/erivoices/fbox/cancel.png',
  5.         'script': '/erivoices/fbox/upload.php',
  6.         'folder': '1502',
  7.         'multi': true,
  8.         'buttonText': 'Add Photos',
  9.         'checkScript': '/erivoices/fbox/check.php',
  10.         'displayData': 'percentage',
  11.         'scriptData': {'serah':1502},
  12.         'fileExt': '*.jpg;*.jpeg;*.gif;*.png',
  13.         'simUploadLimit': 2,
  14.  
  15.  
  16.         onError: function (a, b, c, d) {
  17. if (d.status == 404)
  18. alert('Could not find upload script. Use a path relative to: '+'<?= getcwd() ?>');
  19. else if (d.type === "HTTP")
  20. alert('error '+d.type+": "+d.status);
  21. else if (d.type ==="File Size")
  22. alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
  23. else
  24. alert('error '+d.type+": "+d.text);
  25. },
  26.     });
  27. });
  28.  
  29.  
  30.         function startUpload(id){
  31.  
  32. $('#UploadImages').fileUploadSettings('scriptData',"serah="+id);
  33. //alert('&amp;name='+$('#name3').val()+'&amp;location='+$("#location").val());
  34. $('#UploadImages').fileUploadStart();
  35. }
  36.  
  37.  
And in the body section, I am trying both:

Expand|Select|Wrap|Line Numbers
  1. <div id="UploadImages">Photo Uploader Error</div>
  2.  <a href="javascript:startUpload(1502)">Start Upload</a>
  3.         <a href="javascript:$('#UploadImages').fileUploadStart()">Start Upload</a> |  <a href="javascript:$('#UploadImages').fileUploadClearQueue()">Clear Queue</a></p>
  4.    </div>
  5.  
I am having to Start Upload commands because I want to try them both but both failed. By the way, even the following variable don't go to upload.php

Expand|Select|Wrap|Line Numbers
  1. 'folder': '1502',
  2.  
and upload.php is

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require('../konfig.php');
  3. // JQuery File Upload Plugin v1.4.1 by RonnieSan - (C)2009 Ronnie Garcia
  4. //I want to upload the files to folder 1502 which I must get from GET or POST as it varies from call to call.
  5. if (!empty($_FILES)) {
  6. require(DB);
  7. $workingon=mysql_real_escape_string($_POST[serah]);
  8.     $tempFile = $_FILES['Filedata']['tmp_name'];
  9.  
  10.     $targetPath = GROUPPICTURES.$workingon."/";
  11. //WHERE GROUPPICTURES is a constant defined in konfig.php
  12.  
  13.     $targetFile =  str_replace('//','/',$targetPath) . $_FILES['Filedata']['name'];
  14.  
  15.     // Uncomment the following line if you want to make the directory if it doesn't exist
  16.     // mkdir(str_replace('//','/',$targetPath), 0755, true);
  17.  
  18.     move_uploaded_file($tempFile,$targetFile);
  19.  
  20.  
  21. }
  22.  
  23. echo '1';
  24.  
  25. ?>
  26.  
Dec 21 '10 #1
3 4056
acoder
16,027 Expert Mod 8TB
First check that upload.php is working correctly. Echo out the POSTed variable values.

Next, try out a working example from the uploadify samples following the examples exactly as coded. When you have that working, you can then adapt to your requirements.
Dec 23 '10 #2
samvb
228 100+
hi,

i took the code from the samples in uploadfy. They would work if i want to place the images/files in the same directory as the whole uploadify files, just like in the samples. And upload.php is not accepting the POSTed variables which is the root of the problem. I think the variables are not been posted to it but I don't know why.
Dec 25 '10 #3
'method' : 'GET',
'scriptData': {'serah':1502},

add method parameter with 'GET' in the option. The default method type is 'POST'. I test it, it can pass scriptData to server.
May 14 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Chuck Amadi | last post by:
A little help has anyone used the email-dir.py Email Module ,I have downloaded the example and would like some pointers to get it going . For example Have I got to add any parameters to python...
0
by: Ringo Langly | last post by:
Hi all, We've been using eWebEditPro for a number of years now, and though it works fine for our needs - which are simply HTML editing (no XML, CSS, etc), it's cumbersome to install/setup and...
0
by: Dave R | last post by:
Hi all, Has anyone used UploadData API successfully? The first parameter to the API is the URI where one needs to upload data. If I give a Fully qualified name i.e.http://myserver.mydomain:XX it...
0
by: Brian Basquille | last post by:
Hello all. Quick question for anyone that has used RawMouse / RawInputMouse (and for anyone that hasn't used it.. look here: http://link.mywwwserver.com/~jstookey/arcade/rawmouse/). RawMouse...
0
by: Jens Jensen | last post by:
High, There seem to be a financial class accessible from .Net 2.0 . Has anyone used this? Any sample codes/experience using it? Thanks JJ
0
by: Groove | last post by:
On 10/17, I asked about this in here but never received any responses so I thought I'd try again. I'm looking at AspDotNetStorefront to power my web store - particularly the Pro version ($599). ...
0
by: bolina | last post by:
Has anyone used certmagic.com for CISSP Certified Information Systems Security Professional to study for the CISSP exam?
3
by: Sasha | last post by:
Has anyone used dtSearch .Net Engine? What was your experience? Would you recommend it others? I am deciding on a .net search engine and would like to hear your opinion. Thank you, Sasha
1
by: simonruk1 | last post by:
Just a quick one has anyone used os commerce and how easy is it to install on a sever.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.