Shouldn't this work?

I want to upload the files in the folder on server which the
user selected in the ComboBox. But I cant get it working, any
ideas?
In Flex:
private function startUpload():void {
if (_arrUploadFiles.length > 0) {
disableUI();
listFiles.selectedIndex = _numCurrentUpload;
scrollFiles();
// Variables to send along with upload
var sendVars:URLVariables = new URLVariables();
sendVars.projekt = ComboBox(projektNamn).selectedItem.data;
var request:URLRequest = new URLRequest();
request.data = sendVars;
request.url = _strUploadUrl;
request.method = URLRequestMethod.POST;
_refUploadFile = new FileReference();
_refUploadFile = listFiles.selectedItem.file;
_refUploadFile.addEventListener(ProgressEvent.PROGRESS,
onUploadProgress);
_refUploadFile.addEventListener(Event.COMPLETE,
onUploadComplete);
_refUploadFile.addEventListener(IOErrorEvent.IO_ERROR,
onUploadIoError);
_refUploadFile.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
onUploadSecurityError);
_refUploadFile.upload(request, "file", false);
This in upload.php:
$file_path =
$_SERVER['DOCUMENT_ROOT']."/mockingbird/".$_REQUEST['projekt'];
$file_temp = $_FILES['file']['tmp_name'];
$file_name = $_FILES['file']['name'];
//checks for duplicate files
if (!file_exists($file_path."/".$file_name)) {
//complete upload
$filestatus =
move_uploaded_file($file_temp,$file_path."/".$file_name);
if(!$filestatus) {
$success = "false";
array_push($errors,"Upload failed. Please try again.");
else {
$success = "false";
array_push($errors,"File already exists on server.");
break;
default:
$success = "false";
array_push($errors,"No action was requested.");
return_result($success,$errors,$data);

Thanks for the reply and the information,  the changed made everything work
Totally bogus that a 500GB Wester Dig harddrive made in 2009 would have so many bad blocks.....
What usually produces a bad block, a hard kill of a system?

Similar Messages

  • Shouldn't this work? dd command issues.

    I'm hoping to bring together a hodge podge of old parts lying about into a sweet smoking Arch machine.
    I've got everything I need, except what I thought would be the easiest part of the whole box... a usable hard disk.
    After finding two reasonably new disks, I threw them in the set up I had at the time, everything was peachy-keen.
    Turns out, both disks flop with IO errors after about 36hour uptime, I think they have  bad sectors.... maybe I dreamt this, but I thought
    hard-disk firmware hides bad sectors from the OS by remapping them... maybe not. 
    Anyways  I want to zero both disks, forcing the sectors to be remapped or quarantined off or w/e the manufacturers have them do. 
    So I booted the box up with my trust Arch install disk, booted the live cd and am sitting here at the root prompt
    trying to run
    dd of=/dev/sda if=/dev/null bs=512
    the above returns the stats of execution:
    0+0 records in
    0+0 records out
    0 byte (0 B) copied, etc.
    Is the above bash not attempmting to do what I think it is?
    plz halp! Thanks for reading.

    Thanks for the reply and the information,  the changed made everything work
    Totally bogus that a 500GB Wester Dig harddrive made in 2009 would have so many bad blocks.....
    What usually produces a bad block, a hard kill of a system?

  • Disk image moved between machines--shouldn't this work?

    Hello, I am having a problem making a functional DVD. Here's the scenario:
    I have a MacBook Pro (2009) with iMovie '09 installed, and I have a project I want to burn. The optical drive is broken, and the smart folks at Apple decided that they'd make it impossible for my shiny new external superdrive to work with my MacBook Pro. BUT, I also have a MacBook Air 2012 which can use the superdrive just fine. I can't transfer the iMovie project between machines--iMovie '11 has some terrible bugs when you try to import still photographs. So my solution was this:
    --on the MBP, export the movie from iMovie as a quicktime .mov,
    --open the .mov in iDVD (after experimentation, this gives MUCH better results than choosing "export to iDVD" in iMovie)
    --in iDVD, save as a disk image
    --copy the .img file (using a thumb drive) to the MBA
    --Use Disk Utility on the MBA to burn the disk image just transferred onto a DVD using the external superdrive
    Could someone tell me where this elaborate chain is likely to go wrong? The first disc I tried creating like this could be played on a computer using VLC (and the menu was operational, it wasn't just reading the video file), but it didn't work on either of the regular DVD players I tried.
    Any help troubleshooting would be greatly appreciated. Here are the details of all the settings:iMovie 09 -> export using quicktime -> file type .mov -> compression type H.264, Frame rate current, Key frames automatic, compressor quality Best, encoding Best Quality, Data Rate automatic. In iDVD Preferences I chose NTSC (I'm in North America), encoding Professional Quality, and the correct DVD type (dual layer). In Disk Utility on the MBP I just dragged the transferred .img file into the left-hand pane, selected it and hit Burn.
    When I transferred the .img file, that was all I transferred between machines.
    Thank you!

    the .img file was only ~700 MB (it's a short film). Should it have worked, in this case?
    Don't know - May be ?
    How can I find out whether it (the ext Hard Disk) is formatted as Mac OS extended?
    • Select it on DeskTop/Finder (one Click)
    • then go to File and down to Show Info - or - [cmd+I]
    • read formatted as : nnnnnnnnnnnnnnnnnnn
    And lastly I read elsewhere that DVD-R would be more reliable than DVD+R.
    DVD+R are a more modern format and by so more reliable - BUT OLD DVD-Players can not read them so I chose them due to not knowing what player it will be played on.
    And I think that if the DVD was able to be read on another computer, then it could not have had burn errors right?
    No - but different devices has better or worse Error Correcting Functions - so keeping the amount of Burn Errors dowm = More devices can play them.
    Good Luck.
    Yours Bengt W

  • I own a Pavillion dv7 and my battery completely died. Shouldn't this work with just the plug in?

    HELP! I have a huge presentation on Monday and my battery just died. I would think my Pavillion would work without a battery in it but it will not turn on with or without the battery in it. Shouldn't my laptop work plugged in without the battery?

    It should but if the AC adapter has died, the battery would run down and then you would also not have AC power so it might well not be the battery but the adapter. The only quick fix for that is to go get a universal adapter at Best Buy or Frys but they cost way too much, like $80-100. If you live in a decent sized city you might also have a computer shop that stocks common laptop AC adapters, and yours is a very common type.

  • I have a paused download and can't restart it, nor can I download again. I am running 10.6.8, shouldn't this work? not sure what to do next

    v

    After pausing, clicking on the resume button next to the downloading file should restart it.
    Have you tried opening the App Store, Purchases and click on the software to be downloaded from there?
    You can also go to the Finder, Applications folder and move the partial file to another location, such as your documents folder and then try to download...should fool it into believing it has not been downloaded to that machine.  If it is Yosemite you are trying to download, the file will be Finder, Applications, OS X Yosemite Installer

  • Exporting PDF to Word with Acrobat 8 - Does this work?

    Has anyone had any success with a decent export-to-Word using Acrobat 8 (from CS3)?
    Acrobat 7 is worthless for this. I suspect the woeful results have much to do with how the PDF was made. If it came from InDesign or Illustrator, and has layers, that will no doubt flummox wonky old Word.
    Or, is it the wonky "export to Word" function that's wonky? I see there is also "Export to RTF" which is much the same file format as .doc. You get exactly the same crazy results.
    Here at my job, they have determined the best way to get a decent Word doc out of what we're publishing is to export each individual text box from InDesign as "RTF". Then open word and wrangle all the bits.
    This is time consuming and senseless - certainly the technology exists to convert PDFs to Word cleanly and perfectly.
    Or ... is Adobe just telling us, by quietly setting us up to fail, that we shouldn't be using Word at all? So they're not going to bother to make this work?
    Sadly, at my gig, we need to do this. Our clients are dinosaurs, and the average T-Rex is deathly afraid of Acrobat Reader and PDFs.

    < Frankly, I don't really give a lot of thought to employers who refuse PDFs for graphic design positions. It's like asking me to retouch a photo using MacPaint.>
    A resume is a document, not a design sample. A lot of employers do not want "designed" resumes at all. They want simple searchable text resumes. Even using special formatting features in Word can mess up their processes. HR departments could care less how pretty it is, all they want is data. You'll need to impress the design manager at the interview, after HR has passed it on. Even the hiring manager may find a highly designed resume to be annoying and difficult to read.
    Of course if that's not where you want to work, that's up to you, but you might be turning down excellent design positions by insisting they accept things your way instead of doing things their way! ;-)

  • Why does this work? (dmenu_run shell script...)

    I'm very confused at what this is doing. dwm knowledge would help to understand my question. I don't understand how this script can take a font name with a space in it, the way dwm's default config does, and understand it as one argument.
    #!/bin/sh
    exe=`dmenu_path | dmenu ${1+"$@"}` && exec $exe
    Before updating to a newer version of dmenu (where this is included), I had written my own dmenu_run script. Although I wrote it, I actually don't understand how this one worked either. It was a trial and error thing, and when I try to think it through I always conclude that it shouldn't work.
    #!/bin/bash
    IFS="\t" # (was actually a literal tab character in my script)
    `dmenu_path | dmenu $*`
    This does not work without redefining $IFS, so I figured that dwm is not somehow making sure that spaces are interpretted correctly. But by stopping spaces from separating arguments, shouldn't this cause huge problems for everything except the font name?
    An example of how this would be called by dwm:
    dmenu_run -fn -*-dejavu sans-medium-r-normal-*-12-*-*-*-*-*-*-*
    (Note the space in the font name)
    So what is going on here? I realize that my question is somewhat confusing. I'm happy to clarify anything that is confusing - I found it very hard to clearly ask this question.
    Last edited by fflarex (2008-11-07 05:06:24)

    First off, sorry for all the shell-speak. This is a bit of an edge case, so it's sort of unavoidable. That said, I'll summarize what you need to know at the end.
    The dwm version of the script uses $@ in double quotes. @ contains all the parameters passed to the shell, just like * does. The main useful difference is a special case: when double-quoted, $@ expands to the list of arguments, each as a single shell word. Double-quoted $* expands to the list of arguments as a single word delimited by $IFS. (Both variables expand to the list of arguments [with word splitting applied according to $IFS, hence your spaces problem] when unquoted.) Here's the logic flow:
    1. dwm calls dmenu_run with the list of arguments specified in your config.h. It calls it directly, not running a command through a shell, so word splitting is never performed and spaces in values don't matter.
    2. dmenu_run calls dmenu with the list of arguments it was given. It uses two shell tricks: first, quoted-@ to pass the list of arguments without word splitting. Second, the ${foo+bar} expansion syntax, which expands to bar if foo is defined, otherwise the null string (""). So it expands to the full list of arguments, each as a single word, only if arguments were passed (if $1 is defined).
    What you need to know: You almost always want to use '"$@"'. Unless you want all your arguments as a single string, in which case you want '"$*"'. Other forms are practically useless.
    Last edited by skymt (2008-11-07 14:26:58)

  • Turned "Sort by Album Artist" off on iPod Touch 5th Gen so individual artists on compilation albums will show up separately under "Artists" with no succuss.  This worked perfectly on my Ipod Touch 4th Gen.  Any Advice?

    I have a 5th Gen iPod Touch.  It is running the latest iOS, and iTunes has the latest update.  I have many compilation albums that I imported from CD.  I want the individual artists and their associated song(s) to show up under "Artists."  I have turned off "Sort by Album Artist" in Settings.  This worked perfectly on my 4th Gen Touch.  Each artist from a compilation would show up under "Artists" with the correct song(s) showing, while still showing the whole compilation under "Albums."  Now, on my 5th Gen Touch, when I try to look at an artist from a compilation under "Artists,"  I get one of the following:  the correct artist and song, an incorrect artist and song, or an incorrect artist with the entire compilation album showing up.  Is this a bug in the new iOS 7, or am I doing something wrong?  Anyone else with this problem?  Any advice?

    I have the same problem and I have been really trying hard to find a solution.  No success. 
    My main problem is this:  For example:  Top Gun soundtrack - I look at Kenny Loggins under artists and I see his albums and songs, plus the 2 songs from top gun.  Then when I look at Miami Sound Machine (also on top gun cd) under artist, I see correct albums from Miami sound machine, but under the top gun soundtrack, it shows the 2 kenny loggins songs instead.  then if I look at another artist from top gun cd, it continues to show the kenny loggins songs.  It doesn't matter which songs i look at, but the first one i start with will always show up on the others.  Funny thing is, if I click on the song, the correct song plays, it just says it is the kenny loggins song!!!  ha ha.   Been dealing with this for over a year now.  Pretty aggravating.   Happens whether I have compilations checked or unchecked on settings.   I have over 50 compilation albums and some are checked, some aren't...they all behave this way. 
    On Mac, itunes (v 12) it all shows up correctly and works fine.  I have become an expert on ID tags and am very thorough with my tagging.  HAND TAGGING, not some program that does it for you...they are never correct.  I match all my tag info with the info in the iTunes store for each album so it is sure to match.  Has taken a long, long, long time. 
    Love iTunes match, but this one issue is a real pain.  Anyone with any ideas, I'd love to hear them!  Thanks!

  • My iPhone was stolen and I have contacted the police who are using the meid number to locate.  How does this work and what are my chances of getting the phone back?

    My iPhone was stolen.  I used Find My iPhone app to lock it and display a message.  The phone has not connected to the internet to locate it.  I contacted the police and they have taken my meid number.  How does this work and what are my chances of getting the phone back?  Are there other ways the theif can use it.  I was told once they put in a new sim card and use it, whatever software the police have, it will show up.

    Honestly? In the US (I can't speak to other countries, though I doubt it works much differently in a lot of the world) The police took your report and filed it either in their computers or, on paper. They will now not think of this again. The only time it will cross anyones mind is if, in the course of entering information into evidence about items recovered or seized at a crime scene, the serial number of an iPhone that was found/seized happens to match yours, in which case you will be contacted.
    The police in the US can and will do nothing to 'blok' the phone and it's not worth their time to try and locate it unless you know for a fact that it was stolen by a big time drug lord, master criminal, or some other such prime target and they can get a court order to track the location of the phone in order to locate this individual for your own purposes.  If they do that, they'll probably keep him under surveilance for a year or so before they act.
    Basically, the police don't care about your phone. If they find it, they will give it back to you. They are not, however, going to go looking for it. They have better things to do.
    I'm sorry, but that's the way it is.

  • Was told a USB device would create a PDF automatically from the data contained within when plugged into my USB port. Doesn't seem to work. How does this work and how can I fix the device I received?

    Acrobat is not on the USB device - only Adobe Reader needed on the PC. How does this work? How can I fix this device if at all?

    You need to ask the people who sold it to you. Doesn't sound like it has anything to do with Reader.
    However, you should be wary of devices that automatically try to open files when plugged in. They can also infect your computers with all kinds of viruses or malware.

  • The Daily Show Multi-Pass: how does this work?

    I subscribed to the Daily Show Multi-Pass. The store said it was busy and try again later. So I thought I'd do it later but meanwhile got an email saying I had the multi-pass and 9.99 has been deducted from my account!
    The email has a link to view account preferences. It says that 2 of the 16 episodes have been downloaded - nothing has been downloaded (and only one show is currently available).
    According to the email: "You will receive an email when future episodes of The Daily Show are available and the episodes will be downloaded automatically to the account listed above the next time you sign in to iTunes." What? When is that?
    It would be great if this worked with RSS like podcasts instead of some mysterious download time.
    Is this working for anyone?

    Okay here's what you have to do: Go to the Music
    Store, and click the button with your e-mail address
    at the top right (below "browse"). Then click "Sign
    out" in the popup. Then click where your e-mail
    address used to be to sign in again. Your episode
    will start downloading.
    This is a stupid way for Apple to do it, but at least
    it technically works so until they make it easier
    this is what we're going to have to do every day.
    Argh!
    Hmmm...when I did the above, it ran through the "Checking for purchases" before starting the download. So I wonder if doing the "Check for purchases..." selection under the Advanced menu would do the same thing without the hassle of logging out and in. I'll give it a try tomorrow...

  • HT2357 So how does this work on Mountain Lion? I cannot seem to ignore the iTunes 11 updates, which now seem to appear every 5 minutes!!

    So how does this work on Mountain Lion? I cannot seem to ignore the iTunes 11 updates, which now seem to appear every 5 minutes!!

    Fantastic!  Didn't work at first so restarted App store and tried again.  This time it asked 'ignore update'.  All gone!

  • TS1425 My co worker has given me his iPod to take home and transfer his music to my laptop, however, I am unable to access his music to download it to my computer.  How does this work?

    My co-worker has given me his iPod to take home and transfer his music to my laptop, however, I am unable to access his music to download it to my computer.  How does this work?

    You need to transfer the iTunes Library from the most recent backup you made before the hard drive was replaced.
    You can't transfer the full iTunes Library from the iPad back to iTunes.
    There are third-party Windows applications that will transfer data from an iOS device, but they don't re-create the iTunes Library exactly as it was before.

  • I just bought my 10 year old autistic daughter an IPOD touch that she needs to take to school with just limited music on it but she also also has an IPAD mini for home that is fulllyloaded with apps .  How do I set up Itunes to make this work

    I just bought my 10 year old autistic daughter an IPOD touch that she needs to take to school with just the music (no apps) on it but she also also has an IPAD mini for home that is fullly loaded with apps.  The last time I tried to connect 2 devices to Itunes I ended up loosing my own music library so I am a bit hesitant to start setting up this new IPOD touch with outsome help. Anyone have any ideas on how I set up Itunes to make this work and not loose her IPAD apps and media?

    Open itunes, connect ipad, select what you want, sync.
    Connect ipod, select what you want, sync

  • My wife and I have separate Ids but all our music is in one library. How will this work with iCloud?

    My wife and I have separate Ids but all our music is in one library. How will this work with iCloud? i'm trying to download past purchases from her id, but itunes is saying that I can't because the computer is associated with my apple id. Can I associate the computer with both ids for the purpose of identifying all of our music with both or just one of our ids? Is there a good way to do this? I'm sure we're not the only people with this problem...
    Using 2 iphone 3gs, ipad, mac mini, appletv, itunes for windows, macbook, and imac.

    iTunes- How to share music between different user accounts on a single computer
    You cannot merge two separate libraries across user accounts. Photos does not have the function of merging different Photos.library files. If you have Aperture then you can merge the two before migrating over to Photos.

Maybe you are looking for