An autograph-seeker finds himself on a movie set and dreams he is in Baghdad in this jazzy musical comedy.
Al Babson (Eddie Cantor) lives in a box-car and tells two bums he is going to Hollywood. He sings "Laugh Your Way Through Life" and dances out the door. In the desert Arabian warriors chase him on a movie set. Al wakes to find nurse Dinah (Virginia Field) warning him not to sign a release from damages; but he signs to be an extra. Director Boland (Alan Dinehart) explains the Arabian plot, but Al wants autographs. Boland tells Al to stab the treacherous prince; but Al takes too many pills and falls asleep, dreaming.
Al tries to stab Prince Musah (Douglass Dumbrille) but is captured in old Baghdad. Musah stabs him with the prop knife and is amazed. The Sultan (Roland Young) frees Al, who is called Ali Baba. Yusuf (Tony Martin) gets Princess Miriam (June Lang) to plead for the hungry people. Ali Baba explains how relief helps the poor and relieves the rich of their money. The Sultan is persuaded to feed the people and makes Ali Baba prime minister. Ali Baba plans to disband the army. In black face Ali Baba with African musicians sings "There's Going to Be a Harlem" and "Swing Is Here to Stay."
Prince Musah goes to Kufa to get his army. Ali Baba sees Dinah and meets her rug-maker grandfather Omar (Maurice Cass). Ali Baba tells the Sultan to be elected president so that his daughter Miriam can marry anyone. Yusuf and Ali Baba sing "Vote for Ahmed Bey," but people campaign for Ali Baba, who re-assures the Sultan and speaks against himself. When Ali Baba wins, he faces being boiled in oil; but he escapes. Nine old counselors declare the election unconstitutional. Ali Baba flees disguised as a woman. Prince Musah watches dancers and picks Ali Baba. He says he plans to execute Ali Baba, who is dancing around him, tying him up. Then Ali Baba head-butts Musah and rides off to Dinah and Omar. Ali Baba makes the carpet go up by saying "inflation" and rides it to disperse Musah's army with a burning rope. Musah climbs the rope and fights Ali Baba, who pushes him off as the carpet burns.
Al wakes up on the set, and Boland throws him out. At the movie premiere Al sees Dinah as he collects autographs. Al sees various stars including Eddie Cantor, who sings "Laugh Your Way Through Life."
Satirizing Roosevelt's New Deal more than Arabian stereotypes, this musical comedy diverts as Al's dream becomes more and more absurd until he awakes.