Jump to content

File upload when file repeated


johnhenry

Recommended Posts

I wonder if anyone knows whether this is possible,  Sorry if this should be in the html section, but the rest is a php script.

 

I have to upload a file which always stays the same,  When it is processed for upload I change the name according to some other criteria. 

 

That is all done and working, but what I would like to do is that the person doing the upload does not have to choose the file each time.

 

I tried putting in a value attribute into the form field like this..

<input type="file" name="filename" value="55656-Oct21-2.pdf" size="20">

It seems to ignore the value and processes nothing. Choosing the file works OK.  I just want them to be able to press 'Submit' without looking for it.

 

 

 

Still no joy.

 

Ideas would be appreciated
 

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

I tried out the renaming idea, and I put the renamed file into a new folder. It works well but the problem is that it deletes the master file.

 

How can I do this without losing the original?

 

Here is what I did.

rename("pdf/55656-Oct21-2.pdf", "pdfs/55656.pdf");

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.