Jump to content

Recommended Posts

Hi there,

 

im trying to build a file upload form something like this

 

just simple HTML,

 

<HTML>

<HEAD>

<TITLE>File Uploading Interface</TITLE>

</HEAD>

<BODY>

<CENTER>

<BR><BR>

<FORM ENCTYPE="multipart/form-data" NAME=MyForm ACTION=submit.php METHOD="POST">

<INPUT TYPE="hidden" NAME="command" VALUE="1">

<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="100000">

<TABLE>

<TR>

<TD>Choose File</TD>

<TD><INPUT NAME="MyFile" TYPE="File"></TD>

</TR>

<TR>

<TD COLSPAN="2"><INPUT NAME="submit" VALUE="Upload" TYPE="submit"></TD>

</TR>

</TABLE>

</FORM>

</CENTER>

</BODY>

</HTML>

 

But please not i do not wish to upload a file only grab the File location e.g 'C:\Temp\File1.csv'

there is never actually a file uploaded.

 

so i got the UI no problems, however im not sure if i want to be using a POST method,

 

my ultimate goal is to use the browse button, select a file to be uploaded

pass it as a string and use the php function to change my windows slashes \

to php slashes / and just pass the whole field e.g (C:\temp\file1.csv) then (C:/temp/file1.csv)

as a variable to some code that reads each line of a CSV file that i have made and that

requries the file location. So if all of this happens on one page this is fine i dont need to go to another

page however a message "Upload complete" for example would be excellent.

 

Please assist

 

Thanks

 

Kris

Link to comment
https://forums.phpfreaks.com/topic/53342-file-upload/
Share on other sites

All uploaded files go in to a  temp folder with a random Hash as a file name.  You can then open said file using File handlers and I believe said file is destroyed outta the temp folder after X time.

 

Otherwise take the file say it using a random number hash to a temp folder then open said file take what you need and make a server script to auto clean temp folder every night

Link to comment
https://forums.phpfreaks.com/topic/53342-file-upload/#findComment-263625
Share on other sites

hi and thanks for your response,

 

i think i may have been confusing you.

 

i actually dont want to upload the file i only simply want the browse box then when i push upload want to grab the path in the text box as a varible and pass it into another statement.

 

Please assist.

Link to comment
https://forums.phpfreaks.com/topic/53342-file-upload/#findComment-263667
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.