Pure PHP Upload 3 Support Product Page

Capture PAU3 filename in a session value

Asked 18 Apr 2013 20:38:24
1
has this question
18 Apr 2013 20:38:24 Bart Garner posted:
I am using PAU3 to allow a user to upload a resume. If that file has blank spaces in the name (which is pretty common) PAU replaces the spaces with _.

Upon upload the webserver sends an email to my client with a link to the uploaded file. The file is referenced from the name of the upload field and it works perfectly if there are no spaces in the filename, however, since a file with spaces is renamed, the link is no good.

If I refer to the PAU filename, my email fails as it does not recognized the opject. How can I capture the renamed filename, at the point of hitting submit, into a Session Value so that I can refer to it in the email message?

Replies

Replied 19 Apr 2013 08:02:15
19 Apr 2013 08:02:15 Teodor Kuduschiev replied:
Hello Bart,

You are posting Pure PHP Upload 3 support forum and asking about Pure ASP Upload 3? Which of these products is your question related to?
Replied 19 Apr 2013 22:49:58
19 Apr 2013 22:49:58 Bart Garner replied:
PHP. I guess it is not PAU, but the issue is the same in any event. The behaviour is renaming the file and I need to retrieve the renamed filename and put it in a Session Variable.
Replied 24 Apr 2013 16:02:17
24 Apr 2013 16:02:17 Bart Garner replied:
?
Replied 25 Apr 2013 10:19:08
25 Apr 2013 10:19:08 Teodor Kuduschiev replied:
You can use the fileName binding, under the Upload Form in Bindigs tab in order to get the filename of the uploaded file.
Replied 26 Apr 2013 00:53:49
26 Apr 2013 00:53:49 Bart Garner replied:
That gives me the native filename, before your extension renames it.
Replied 26 Apr 2013 07:26:39
26 Apr 2013 07:26:39 Teodor Kuduschiev replied:
The Filename Binding gives you the name of the uploaded file, if it is renamed, this is stored there.
Replied 23 May 2013 22:46:57
23 May 2013 22:46:57 Bart Garner replied:
I continue to be frustrated by this. I need to email the NEW filename on upload. To do this, I have to pass the filename into a Session Value on the upload page but I cannot make it work. I have placed my Session code AFTER the PHP upload code and used Current Page Submit as the trigger but the Session Value is empty.

[php]
<?php
if (!session_id()) session_start();
if(($_SERVER["REQUEST_METHOD"] == "POST" && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) {
$_SESSION["cv"] = "".$resumes->folderList("name" ."";
}
?>
[/php]

If I place it ahead of the PHP Upload code the page will not load as it throws an error on the reference to folderList.

Reply to this topic