user656925
user656925

Reputation:

Why is File Upload breaking multiple things

My web app runs well except one thing. File Uplods. Basically when a user logs on and submits their information, after validation on client and server side, their file is uploaded programtically by javascript using the submit method. Once the file is submitted php inlcudes the main page for the user to view.

The issue I'm having is that now when the user hits reload from the main page IE pops up a window saying that informatin needs to be resent again. I don't know what information IE is referring to. But I don't want this window popping up.

Also now when the user logs out, it does not work because the $_FILES super global is still set from the file upload. This effectively breaks the signout as the error is displayed to the browser.

I'm pretty sure I'm doing something wrong as $_FILES is not being cleared after the submit...and IE seems to think that there is some "information" that the user needs to be alerted to on reloads.

But the SignIn and TryIts all work as I expected; it is the SignUp which inlcudes the file upload which breaks these two things.

I'm not sure what code to post, but let me know and I can post what is needed

Upvotes: 0

Views: 63

Answers (1)

Artem Goutsoul
Artem Goutsoul

Reputation: 753

Use a different PHP file (different URL) for submit action.

After processing your file upload, redirect back to where you want to be using:

header("Location: http://your.server/your_path/");

Upvotes: 1

Related Questions